X-Git-Url: http://git.archive.openwrt.org/?a=blobdiff_plain;f=documentation%2Fapi%2Fmodules%2Fluci.http.html;fp=documentation%2Fapi%2Fmodules%2Fluci.http.html;h=d75863fa6e9d66ad71dbae1a175e878af0ecb23a;hb=27dd9d75f9e920150353db85cb126f2c83e89140;hp=ea04fc236e21cbb49b0d1d94bb76cb153430b1fa;hpb=00d242918f7de007f2a05f102a9660074013293f;p=project%2Fluci.git
diff --git a/documentation/api/modules/luci.http.html b/documentation/api/modules/luci.http.html
index ea04fc236..d75863fa6 100644
--- a/documentation/api/modules/luci.http.html
+++ b/documentation/api/modules/luci.http.html
@@ -41,19 +41,15 @@
@@ -256,7 +252,6 @@ Get the value of a certain HTTP-Cookie.
Get the value of a certain HTTP environment variable
-
or the environment table itself. |
@@ -268,6 +263,20 @@ Send a HTTP-Header.
+ mimedecode_message_body (src, msg, filecb) |
+
+
+Decode a mime encoded http message body with multipart/form-data Content-Type. |
+
+
+
+ parse_message_body (src, msg, filecb) |
+
+
+Try to extract and decode a http message body from the given ltn12 source. |
+
+
+
prepare_content (mime) |
@@ -311,6 +320,44 @@ Set the HTTP status code and status message. |
+ urldecode (str, no_plus) |
+
+
+Return the URL-decoded equivalent of a string. |
+
+
+
+ urldecode_message_body (src, msg) |
+
+
+Decode an urlencoded http message body with application/x-www-urlencoded
+Content-Type. |
+
+
+
+ urldecode_params (url, tbl) |
+
+
+Extract and split urlencoded data pairs, separated bei either "&" or ";"
+from given url or string. |
+
+
+
+ urlencode (str) |
+
+
+Return the URL-encoded equivalent of a string. |
+
+
+
+ urlencode_params (tbl) |
+
+
+Encode each key-value-pair in given table to x-www-urlencoded format,
+separated by "&". |
+
+
+
write (content, src_err) |
@@ -377,7 +424,6 @@ Encoded HTTP query string
Close the HTTP-Connection.
-
@@ -527,8 +573,8 @@ String containing cookie data
Get the value of a certain HTTP environment variable
-
-or the environment table itself.
+or the environment table itself.
+
Parameters
@@ -588,6 +634,135 @@ Send a HTTP-Header.
+mimedecode_message_body (src, msg, filecb)
+
+
+
+Decode a mime encoded http message body with multipart/form-data Content-Type.
+
+Stores all extracted data associated with its parameter name
+in the params table within the given message object. Multiple parameter
+values are stored as tables, ordinary ones as strings.
+
+If an optional file callback function is given then it is feeded with the
+file contents chunk by chunk and only the extracted file name is stored
+within the params table. The callback function will be called subsequently
+with three arguments:
+ o Table containing decoded (name, file) and raw (headers) mime header data
+ o String value containing a chunk of the file data
+ o Boolean which indicates wheather the current chunk is the last one (eof)
+
+
+
+Parameters
+
+
+ -
+ src: Ltn12 source function
+
+
+ -
+ msg: HTTP message object
+
+
+ -
+ filecb: File callback function (optional)
+
+
+
+
+
+
+
+
+
+Return values:
+
+
+ - Value indicating successful operation (not nil means "ok")
+
+
- String containing the error if unsuccessful
+
+
+
+
+
+See also:
+
+
+
+
+
+
+
+parse_message_body (src, msg, filecb)
+
+
+
+Try to extract and decode a http message body from the given ltn12 source.
+This function will examine the Content-Type within the given message object
+to select the appropriate content decoder.
+
+Currently the application/x-www-urlencoded and application/form-data
+mime types are supported. If the encountered content encoding can't be
+handled then the whole message body will be stored unaltered as "content"
+property within the given message object.
+
+
+
+Parameters
+
+
+ -
+ src: Ltn12 source function
+
+
+ -
+ msg: HTTP message object
+
+
+ -
+ filecb: File data callback (optional, see mimedecode_message_body())
+
+
+
+
+
+
+
+
+
+Return values:
+
+
+ - Value indicating successful operation (not nil means "ok")
+
+
- String containing the error if unsuccessful
+
+
+
+
+
+See also:
+
+
+
+
+
+
+
prepare_content (mime)
@@ -764,6 +939,243 @@ Set the HTTP status code and status message.
+urldecode (str, no_plus)
+
+
+
+Return the URL-decoded equivalent of a string.
+
+
+
+Parameters
+
+
+ -
+ str: URL-encoded string
+
+
+ -
+ no_plus: Don't decode + to " "
+
+
+
+
+
+
+
+
+
+Return value:
+URL-decoded string
+
+
+
+See also:
+
+
+
+
+
+
+
+urldecode_message_body (src, msg)
+
+
+
+Decode an urlencoded http message body with application/x-www-urlencoded
+Content-Type.
+
+Stores all extracted data associated with its parameter name in the params
+table within the given message object. Multiple parameter values are stored
+as tables, ordinary ones as strings.
+
+
+
+Parameters
+
+
+ -
+ src: Ltn12 source function
+
+
+ -
+ msg: HTTP message object
+
+
+
+
+
+
+
+
+
+Return values:
+
+
+ - Value indicating successful operation (not nil means "ok")
+
+
- String containing the error if unsuccessful
+
+
+
+
+
+See also:
+
+
+
+
+
+
+
+urldecode_params (url, tbl)
+
+
+
+Extract and split urlencoded data pairs, separated bei either "&" or ";"
+from given url or string. Returns a table with urldecoded values.
+
+Simple parameters are stored as string values associated with the parameter
+name within the table. Parameters with multiple values are stored as array
+containing the corresponding values.
+
+
+
+Parameters
+
+
+ -
+ url: The url or string which contains x-www-urlencoded form data
+
+
+ -
+ tbl: Use the given table for storing values (optional)
+
+
+
+
+
+
+
+
+
+Return value:
+Table containing the urldecoded parameters
+
+
+
+See also:
+
+
+
+
+
+
+
+urlencode (str)
+
+
+
+Return the URL-encoded equivalent of a string.
+
+
+
+Parameters
+
+
+ -
+ str: Source string
+
+
+
+
+
+
+
+
+
+Return value:
+URL-encoded string
+
+
+
+See also:
+
+
+
+
+
+
+
+urlencode_params (tbl)
+
+
+
+Encode each key-value-pair in given table to x-www-urlencoded format,
+separated by "&".
+
+Tables are encoded as parameters with multiple values by repeating the
+parameter name with each value.
+
+
+
+Parameters
+
+
+ -
+ tbl: Table with the values
+
+
+
+
+
+
+
+
+
+Return value:
+String containing encoded values
+
+
+
+See also:
+
+
+
+
+
+
+
write (content, src_err)
@@ -771,7 +1183,8 @@ Set the HTTP status code and status message.
Send a chunk of content data to the client.
This function is as a valid LTN12 sink.
-If the content chunk is nil this function will automatically invoke close.
+If the content chunk is nil this function will automatically invoke close.
+
Parameters
|