166 lines
2.8 KiB
Plaintext
166 lines
2.8 KiB
Plaintext
---[[
|
|
LuCI Web Framework high-level HTTP functions.
|
|
]]
|
|
module "luci.http"
|
|
|
|
---[[
|
|
Close the HTTP-Connection.
|
|
|
|
|
|
@class function
|
|
@name close
|
|
]]
|
|
|
|
---[[
|
|
Return the request content if the request was of unknown type.
|
|
|
|
@class function
|
|
@name content
|
|
@return HTTP request body
|
|
@return HTTP request body length
|
|
]]
|
|
|
|
---[[
|
|
Get a certain HTTP input value or a table of all input values.
|
|
|
|
@class function
|
|
@name formvalue
|
|
@param name Name of the GET or POST variable to fetch
|
|
@param noparse Don't parse POST data before getting the value
|
|
@return HTTP input value or table of all input value
|
|
]]
|
|
|
|
---[[
|
|
Get a table of all HTTP input values with a certain prefix.
|
|
|
|
@class function
|
|
@name formvaluetable
|
|
@param prefix Prefix
|
|
@return Table of all HTTP input values with given prefix
|
|
]]
|
|
|
|
---[[
|
|
Get the value of a certain HTTP-Cookie.
|
|
|
|
@class function
|
|
@name getcookie
|
|
@param name Cookie Name
|
|
@return String containing cookie data
|
|
]]
|
|
|
|
---[[
|
|
Get the value of a certain HTTP environment variable
|
|
|
|
or the environment table itself.
|
|
@class function
|
|
@name getenv
|
|
@param name Environment variable
|
|
@return HTTP environment value or environment table
|
|
]]
|
|
|
|
---[[
|
|
Set a handler function for incoming user file uploads.
|
|
|
|
@class function
|
|
@name setfilehandler
|
|
@param callback Handler function
|
|
]]
|
|
|
|
---[[
|
|
Send a HTTP-Header.
|
|
|
|
@class function
|
|
@name header
|
|
@param key Header key
|
|
@param value Header value
|
|
]]
|
|
|
|
---[[
|
|
Set the mime type of following content data.
|
|
|
|
@class function
|
|
@name prepare_content
|
|
@param mime Mimetype of following content
|
|
]]
|
|
|
|
---[[
|
|
Get the RAW HTTP input source
|
|
|
|
@class function
|
|
@name source
|
|
@return HTTP LTN12 source
|
|
]]
|
|
|
|
---[[
|
|
Set the HTTP status code and status message.
|
|
|
|
@class function
|
|
@name status
|
|
@param code Status code
|
|
@param message 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.
|
|
@class function
|
|
@name write
|
|
@param content Content chunk
|
|
@param src_err Error object from source (optional)
|
|
@see close
|
|
]]
|
|
|
|
---[[
|
|
Splice data from a filedescriptor to the client.
|
|
|
|
@class function
|
|
@name splice
|
|
@param fp File descriptor
|
|
@param size Bytes to splice (optional)
|
|
]]
|
|
|
|
---[[
|
|
Redirects the client to a new URL and closes the connection.
|
|
|
|
@class function
|
|
@name redirect
|
|
@param url Target URL
|
|
]]
|
|
|
|
---[[
|
|
Create a querystring out of a table of key - value pairs.
|
|
|
|
@class function
|
|
@name build_querystring
|
|
@param table Query string source table
|
|
@return Encoded HTTP query string
|
|
]]
|
|
|
|
---[[
|
|
Return the URL-decoded equivalent of a string.
|
|
|
|
@param str URL-encoded string
|
|
@param no_plus Don't decode + to " "
|
|
@return URL-decoded string
|
|
@see urlencode
|
|
]]
|
|
|
|
---[[
|
|
Return the URL-encoded equivalent of a string.
|
|
|
|
@param str Source string
|
|
@return URL-encoded string
|
|
@see urldecode
|
|
]]
|
|
|
|
---[[
|
|
Send the given data as JSON encoded string.
|
|
|
|
@class function
|
|
@name write_json
|
|
@param data Data to send
|
|
]]
|
|
|