]> granicus.if.org Git - apache/commitdiff
Note that parseargs and parsebody actually returns two tables, not one.
authorDaniel Gruno <humbedooh@apache.org>
Mon, 29 Apr 2013 12:31:42 +0000 (12:31 +0000)
committerDaniel Gruno <humbedooh@apache.org>
Mon, 29 Apr 2013 12:31:42 +0000 (12:31 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1477001 13f79535-47bb-0310-9956-ffa450edef68

docs/manual/mod/mod_lua.xml

index 01489df2f37c5d40d3d3692dc504746fd54bd0a3..74192ba5f71c89dba47585995eda4de9a8e7c7b7 100644 (file)
@@ -411,13 +411,22 @@ end
         </highlight>
 
         <highlight language="lua">
-        r:parseargs() -- returns a lua table containing the request's query string arguments
-        </highlight>
-        <highlight language="lua">
-r:parsebody([sizeLimit]) -- parse the request body as a POST and return  a lua table.
+r:parseargs() -- returns two tables; one standard key/value table for regular GET data, 
+              -- and one for multi-value data (fx. foo=1&amp;foo=2&amp;foo=3):
+
+local GET, GETMULTI = r:parseargs()
+r:puts("Your name is: " .. GET['name'] or "Unknown")
+</highlight>
+
+<highlight language="lua">
+r:parsebody([sizeLimit]) -- parse the request body as a POST and return two lua tables,
+                         -- just like r:parseargs().
                          -- An optional number may be passed to specify the maximum number 
-                         -- of bytes to parse. Default is 8192 bytes.
-        </highlight>
+                         -- of bytes to parse. Default is 8192 bytes:
+                 
+local POST, POSTMULTI = r:parsebody(1024*1024)
+r:puts("Your name is: " .. POST['name'] or "Unknown")
+</highlight>
         <highlight language="lua">
         r:puts("hello", " world", "!") -- print to response body
         </highlight>