mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-19 19:40:56 +00:00
using mg.read() only for POST requests
This commit is contained in:
1 parent
30f71a8bc4
commit
e645b33b6c
1 file changed
+7
-1
@@ -24,7 +24,13 @@ Content-Type: text/html
|
|||||||
<form method="POST" ><input type="text" name="t1"/><input type="submit"></form>
|
<form method="POST" ><input type="text" name="t1"/><input type="submit"></form>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
POST data: [<? mg.write(mg.read())?>]
|
POST data: [<?
|
||||||
|
local post_data = ''
|
||||||
|
if mg.request_info.request_method == 'POST' then
|
||||||
|
post_data = mg.read()
|
||||||
|
end
|
||||||
|
mg.write(post_data)
|
||||||
|
?>]
|
||||||
request method: [<? mg.write(mg.request_info.request_method) ?>]
|
request method: [<? mg.write(mg.request_info.request_method) ?>]
|
||||||
IP/port: [<? mg.write(mg.request_info.remote_ip, ':',
|
IP/port: [<? mg.write(mg.request_info.remote_ip, ':',
|
||||||
mg.request_info.remote_port) ?>]
|
mg.request_info.remote_port) ?>]
|
||||||
|
|||||||
Reference in new issue
Block a user