Move inline documentation into separate files.
[project/luci.git] / modules / luci-base / luasrc / http.luadoc
1 ---[[
2 LuCI Web Framework high-level HTTP functions.
3
4 module "luci.http"
5 ]]
6
7 ---[[
8 Close the HTTP-Connection.
9
10
11 @class function
12 @name close
13 ]]
14
15 ---[[
16 Return the request content if the request was of unknown type.
17
18 @class function
19 @name content
20 @return HTTP request body
21 @return HTTP request body length
22 ]]
23
24 ---[[
25 Get a certain HTTP input value or a table of all input values.
26
27 @class function
28 @name formvalue
29 @param name             Name of the GET or POST variable to fetch
30 @param noparse  Don't parse POST data before getting the value
31 @return                 HTTP input value or table of all input value
32 ]]
33
34 ---[[
35 Get a table of all HTTP input values with a certain prefix.
36
37 @class function
38 @name formvaluetable
39 @param prefix   Prefix
40 @return                 Table of all HTTP input values with given prefix
41 ]]
42
43 ---[[
44 Get the value of a certain HTTP-Cookie.
45
46 @class function
47 @name getcookie
48 @param name             Cookie Name
49 @return                 String containing cookie data
50 ]]
51
52 ---[[
53 Get the value of a certain HTTP environment variable
54
55 or the environment table itself.
56 @class function
57 @name getenv
58 @param name             Environment variable
59 @return                 HTTP environment value or environment table
60 ]]
61
62 ---[[
63 Set a handler function for incoming user file uploads.
64
65 @class function
66 @name setfilehandler
67 @param callback Handler function
68 ]]
69
70 ---[[
71 Send a HTTP-Header.
72
73 @class function
74 @name header
75 @param key      Header key
76 @param value Header value
77 ]]
78
79 ---[[
80 Set the mime type of following content data.
81
82 @class function
83 @name prepare_content
84 @param mime     Mimetype of following content
85 ]]
86
87 ---[[
88 Get the RAW HTTP input source
89
90 @class function
91 @name source
92 @return HTTP LTN12 source
93 ]]
94
95 ---[[
96 Set the HTTP status code and status message.
97
98 @class function
99 @name status
100 @param code             Status code
101 @param message  Status message
102 ]]
103
104 ---[[
105 Send a chunk of content data to the client.
106
107 This function is as a valid LTN12 sink.
108 If the content chunk is nil this function will automatically invoke close.
109 @class function
110 @name write
111 @param content  Content chunk
112 @param src_err  Error object from source (optional)
113 @see close
114 ]]
115
116 ---[[
117 Splice data from a filedescriptor to the client.
118
119 @class function
120 @name splice
121 @param fp       File descriptor
122 @param size     Bytes to splice (optional)
123 ]]
124
125 ---[[
126 Redirects the client to a new URL and closes the connection.
127
128 @class function
129 @name redirect
130 @param url      Target URL
131 ]]
132
133 ---[[
134 Create a querystring out of a table of key - value pairs.
135
136 @class function
137 @name build_querystring
138 @param table            Query string source table
139 @return                 Encoded HTTP query string
140 ]]
141
142 ---[[
143 Return the URL-decoded equivalent of a string.
144
145 @param str              URL-encoded string
146 @param no_plus  Don't decode + to " "
147 @return                 URL-decoded string
148 @see urlencode
149 ]]
150
151 ---[[
152 Return the URL-encoded equivalent of a string.
153
154 @param str              Source string
155 @return                 URL-encoded string
156 @see urldecode
157 ]]
158
159 ---[[
160 Send the given data as JSON encoded string.
161
162 @class function
163 @name write_json
164 @param data             Data to send
165 ]]
166