summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base/luasrc/http.luadoc
blob: 4e31216a1e8c3aae01272789c7d6e48dc9f431e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
---[[
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
]]