Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
mongoose
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Gitlab has been updated. More info
here
.
Show more breadcrumbs
Ganil-acq
GANILinux
linux-service
library
mongoose
Commits
f0571f9f
Commit
f0571f9f
authored
11 years ago
by
Sergey Lyubka
Browse files
Options
Downloads
Patches
Plain Diff
Using mg.request_info.content
parent
a3663da9
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/lua/prime_numbers.lp
+15
-19
15 additions, 19 deletions
examples/lua/prime_numbers.lp
with
15 additions
and
19 deletions
examples/lua/prime_numbers.lp
+
15
−
19
View file @
f0571f9f
...
...
@@ -23,24 +23,20 @@ Content-Type: text/html
<p>
Reading POST data from Lua (click submit):
</p>
<form
method=
"POST"
><input
type=
"text"
name=
"t1"
/><input
type=
"submit"
></form>
<pre>
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) ?>
]
IP/port: [
<? mg.write(mg.request_info.remote_ip, ':',
mg.request_info.remote_port) ?>
]
URI: [
<? mg.write(mg.request_info.uri) ?>
]
HTTP version [
<? mg.write(mg.request_info.http_version) ?>
]
HEADERS:
<?
for name, value in pairs(mg.request_info.http_headers) do
mg.write(name, ':', value, '\n')
end
?>
<pre>
POST data: [
<? mg.write(mg.request_info.content) ?>
]
request method: [
<? mg.write(mg.request_info.request_method) ?>
]
IP/port: [
<?mg.write(mg.request_info.remote_ip, ':',
mg.request_info.remote_port) ?>
]
URI: [
<? mg.write(mg.request_info.uri) ?>
]
HTTP version [
<? mg.write(mg.request_info.http_version) ?>
]
Content Len: [
<? mg.write(mg.request_info.content_len) ?>
]
HEADERS:
<?
for name, value in pairs(mg.request_info.http_headers) do
mg.write(name, ':', value, '\n')
end
?>
</pre>
</html>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment