Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongoose
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
esp
mongoose
Commits
f0571f9f
Commit
f0571f9f
authored
Jan 13, 2014
by
Sergey Lyubka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Using mg.request_info.content
parent
a3663da9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
19 deletions
+15
-19
prime_numbers.lp
examples/lua/prime_numbers.lp
+15
-19
No files found.
examples/lua/prime_numbers.lp
View file @
f0571f9f
...
@@ -23,24 +23,20 @@ Content-Type: text/html
...
@@ -23,24 +23,20 @@ Content-Type: text/html
<p>
Reading POST data from Lua (click submit):
</p>
<p>
Reading POST data from Lua (click submit):
</p>
<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: [
<?
POST data: [
<? mg.write(mg.request_info.content) ?>
]
local post_data = ''
request method: [
<? mg.write(mg.request_info.request_method) ?>
]
if mg.request_info.request_method == 'POST' then
IP/port: [
<?mg.write(mg.request_info.remote_ip, ':',
post_data = mg.read()
end
mg.write(post_data)
?>
]
request method: [
<? mg.write(mg.request_info.request_method) ?>
]
IP/port: [
<? mg.write(mg.request_info.remote_ip, ':',
mg.request_info.remote_port) ?>
]
mg.request_info.remote_port) ?>
]
URI: [
<? mg.write(mg.request_info.uri) ?>
]
URI: [
<? mg.write(mg.request_info.uri) ?>
]
HTTP version [
<? mg.write(mg.request_info.http_version) ?>
]
HTTP version [
<? mg.write(mg.request_info.http_version) ?>
]
HEADERS:
Content Len: [
<? mg.write(mg.request_info.content_len) ?>
]
<?
HEADERS:
<?
for name, value in pairs(mg.request_info.http_headers) do
for name, value in pairs(mg.request_info.http_headers) do
mg.write(name, ':', value, '\n')
mg.write(name, ':', value, '\n')
end
end
?>
?>
</pre>
</pre>
</html>
</html>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment