Move doc/ to documentation/api/
[project/luci.git] / documentation / api / modules / luci.http.protocol.conditionals.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html>
4 <head>
5     <title>Reference</title>
6     <link rel="stylesheet" href="../luadoc.css" type="text/css" />
7         <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/-->
8 </head>
9
10 <body>
11 <div id="container">
12
13 <div id="product">
14         <div id="product_logo"></div>
15         <div id="product_name"><big><b></b></big></div>
16         <div id="product_description"></div>
17 </div> <!-- id="product" -->
18
19 <div id="main">
20
21 <div id="navigation">
22
23
24 <h1>LuaDoc</h1>
25 <ul>
26         
27         <li><a href="../index.html">Index</a></li>
28         
29 </ul>
30
31
32 <!-- Module list -->
33
34 <h1>Modules</h1>
35 <ul>
36
37         <li>
38                 <a href="../modules/luci.dispatcher.html">luci.dispatcher</a>
39         </li>
40
41         <li>
42                 <a href="../modules/luci.http.protocol.html">luci.http.protocol</a>
43         </li>
44
45         <li><strong>luci.http.protocol.conditionals</strong></li>
46         
47         <li>
48                 <a href="../modules/luci.http.protocol.date.html">luci.http.protocol.date</a>
49         </li>
50
51         <li>
52                 <a href="../modules/luci.http.protocol.mime.html">luci.http.protocol.mime</a>
53         </li>
54
55         <li>
56                 <a href="../modules/luci.i18n.html">luci.i18n</a>
57         </li>
58
59         <li>
60                 <a href="../modules/luci.ip.html">luci.ip</a>
61         </li>
62
63         <li>
64                 <a href="../modules/luci.ip.cidr.html">luci.ip.cidr</a>
65         </li>
66
67         <li>
68                 <a href="../modules/luci.jsonc.html">luci.jsonc</a>
69         </li>
70
71         <li>
72                 <a href="../modules/luci.jsonc.parser.html">luci.jsonc.parser</a>
73         </li>
74
75         <li>
76                 <a href="../modules/luci.sys.init.html">luci.sys.init</a>
77         </li>
78
79         <li>
80                 <a href="../modules/luci.sys.iptparser.html">luci.sys.iptparser</a>
81         </li>
82
83         <li>
84                 <a href="../modules/luci.sys.net.html">luci.sys.net</a>
85         </li>
86
87         <li>
88                 <a href="../modules/luci.sys.process.html">luci.sys.process</a>
89         </li>
90
91         <li>
92                 <a href="../modules/luci.sys.user.html">luci.sys.user</a>
93         </li>
94
95         <li>
96                 <a href="../modules/luci.sys.wifi.html">luci.sys.wifi</a>
97         </li>
98
99         <li>
100                 <a href="../modules/nixio.html">nixio</a>
101         </li>
102
103         <li>
104                 <a href="../modules/nixio.CHANGELOG.html">nixio.CHANGELOG</a>
105         </li>
106
107         <li>
108                 <a href="../modules/nixio.CryptoHash.html">nixio.CryptoHash</a>
109         </li>
110
111         <li>
112                 <a href="../modules/nixio.File.html">nixio.File</a>
113         </li>
114
115         <li>
116                 <a href="../modules/nixio.README.html">nixio.README</a>
117         </li>
118
119         <li>
120                 <a href="../modules/nixio.Socket.html">nixio.Socket</a>
121         </li>
122
123         <li>
124                 <a href="../modules/nixio.TLSContext.html">nixio.TLSContext</a>
125         </li>
126
127         <li>
128                 <a href="../modules/nixio.TLSSocket.html">nixio.TLSSocket</a>
129         </li>
130
131         <li>
132                 <a href="../modules/nixio.UnifiedIO.html">nixio.UnifiedIO</a>
133         </li>
134
135         <li>
136                 <a href="../modules/nixio.bin.html">nixio.bin</a>
137         </li>
138
139         <li>
140                 <a href="../modules/nixio.bit.html">nixio.bit</a>
141         </li>
142
143         <li>
144                 <a href="../modules/nixio.crypto.html">nixio.crypto</a>
145         </li>
146
147         <li>
148                 <a href="../modules/nixio.fs.html">nixio.fs</a>
149         </li>
150
151 </ul>
152
153
154
155 <!-- File list -->
156
157
158
159
160
161
162
163 </div><!-- id="navigation" -->
164
165 <div id="content">
166
167 <h1>Class <code>luci.http.protocol.conditionals</code></h1>
168
169 <p></p>
170
171
172
173
174
175
176
177 <h2>Functions</h2>
178 <table class="function_list">
179
180         <tr>
181         <td class="name" nowrap><a href="#if_match">if_match</a>&nbsp;(req, stat)</td>
182         <td class="summary">
183  
184 14.24 / If-Match 
185  
186 Test whether the given message object contains an "If-Match" header and 
187 compare it against the given stat object.</td>
188         </tr>
189
190         <tr>
191         <td class="name" nowrap><a href="#if_modified_since">if_modified_since</a>&nbsp;(req, stat)</td>
192         <td class="summary">
193  
194 14.25 / If-Modified-Since 
195  
196 Test whether the given message object contains an "If-Modified-Since" header 
197 and compare it against the given stat object.</td>
198         </tr>
199
200         <tr>
201         <td class="name" nowrap><a href="#if_none_match">if_none_match</a>&nbsp;(req, stat)</td>
202         <td class="summary">
203  
204 14.26 / If-None-Match 
205  
206 Test whether the given message object contains an "If-None-Match" header and 
207 compare it against the given stat object.</td>
208         </tr>
209
210         <tr>
211         <td class="name" nowrap><a href="#if_range">if_range</a>&nbsp;(req, stat)</td>
212         <td class="summary">
213  
214 14.27 / If-Range 
215  
216 The If-Range header is currently not implemented due to the lack of general 
217 byte range stuff in luci.http.protocol .</td>
218         </tr>
219
220         <tr>
221         <td class="name" nowrap><a href="#if_unmodified_since">if_unmodified_since</a>&nbsp;(req, stat)</td>
222         <td class="summary">
223  
224 14.28 / If-Unmodified-Since 
225  
226 Test whether the given message object contains an "If-Unmodified-Since" 
227 header and compare it against the given stat object.</td>
228         </tr>
229
230         <tr>
231         <td class="name" nowrap><a href="#mk_etag">mk_etag</a>&nbsp;(stat)</td>
232         <td class="summary">
233  
234 Implement 14.19 / ETag.</td>
235         </tr>
236
237 </table>
238
239
240
241
242
243
244 <br/>
245 <br/>
246
247
248 <h2><a name="functions"></a>Functions</h2>
249 <dl class="function">
250
251
252
253 <dt><a name="if_match"></a><strong>if_match</strong>&nbsp;(req, stat)</dt>
254 <dd>
255
256  
257 14.24 / If-Match 
258  
259 Test whether the given message object contains an "If-Match" header and 
260 compare it against the given stat object.
261
262
263 <h3>Parameters</h3>
264 <ul>
265         
266         <li>
267           req: HTTP request message object
268         </li>
269         
270         <li>
271           stat: A file.stat object
272         </li>
273         
274 </ul>
275
276
277
278
279
280
281 <h3>Return values:</h3>
282 <ol>
283         
284         <li>Boolean indicating whether the precondition is ok
285         
286         <li>Alternative status code if the precondition failed
287         
288 </ol>
289
290
291
292 </dd>
293
294
295
296
297 <dt><a name="if_modified_since"></a><strong>if_modified_since</strong>&nbsp;(req, stat)</dt>
298 <dd>
299
300  
301 14.25 / If-Modified-Since 
302  
303 Test whether the given message object contains an "If-Modified-Since" header 
304 and compare it against the given stat object.
305
306
307 <h3>Parameters</h3>
308 <ul>
309         
310         <li>
311           req: HTTP request message object
312         </li>
313         
314         <li>
315           stat: A file.stat object
316         </li>
317         
318 </ul>
319
320
321
322
323
324
325 <h3>Return values:</h3>
326 <ol>
327         
328         <li>Boolean indicating whether the precondition is ok
329         
330         <li>Alternative status code if the precondition failed
331         
332         <li>Table containing extra HTTP headers if the precondition failed
333         
334 </ol>
335
336
337
338 </dd>
339
340
341
342
343 <dt><a name="if_none_match"></a><strong>if_none_match</strong>&nbsp;(req, stat)</dt>
344 <dd>
345
346  
347 14.26 / If-None-Match 
348  
349 Test whether the given message object contains an "If-None-Match" header and 
350 compare it against the given stat object.
351
352
353 <h3>Parameters</h3>
354 <ul>
355         
356         <li>
357           req: HTTP request message object
358         </li>
359         
360         <li>
361           stat: A file.stat object
362         </li>
363         
364 </ul>
365
366
367
368
369
370
371 <h3>Return values:</h3>
372 <ol>
373         
374         <li>Boolean indicating whether the precondition is ok
375         
376         <li>Alternative status code if the precondition failed
377         
378         <li>Table containing extra HTTP headers if the precondition failed
379         
380 </ol>
381
382
383
384 </dd>
385
386
387
388
389 <dt><a name="if_range"></a><strong>if_range</strong>&nbsp;(req, stat)</dt>
390 <dd>
391
392  
393 14.27 / If-Range 
394  
395 The If-Range header is currently not implemented due to the lack of general 
396 byte range stuff in luci.http.protocol . This function will always return 
397 false, 412 to indicate a failed precondition.
398
399
400 <h3>Parameters</h3>
401 <ul>
402         
403         <li>
404           req: HTTP request message object
405         </li>
406         
407         <li>
408           stat: A file.stat object
409         </li>
410         
411 </ul>
412
413
414
415
416
417
418 <h3>Return values:</h3>
419 <ol>
420         
421         <li>Boolean indicating whether the precondition is ok
422         
423         <li>Alternative status code if the precondition failed
424         
425 </ol>
426
427
428
429 </dd>
430
431
432
433
434 <dt><a name="if_unmodified_since"></a><strong>if_unmodified_since</strong>&nbsp;(req, stat)</dt>
435 <dd>
436
437  
438 14.28 / If-Unmodified-Since 
439  
440 Test whether the given message object contains an "If-Unmodified-Since" 
441 header and compare it against the given stat object.
442
443
444 <h3>Parameters</h3>
445 <ul>
446         
447         <li>
448           req: HTTP request message object
449         </li>
450         
451         <li>
452           stat: A file.stat object
453         </li>
454         
455 </ul>
456
457
458
459
460
461
462 <h3>Return values:</h3>
463 <ol>
464         
465         <li>Boolean indicating whether the precondition is ok
466         
467         <li>Alternative status code if the precondition failed
468         
469 </ol>
470
471
472
473 </dd>
474
475
476
477
478 <dt><a name="mk_etag"></a><strong>mk_etag</strong>&nbsp;(stat)</dt>
479 <dd>
480
481  
482 Implement 14.19 / ETag. 
483
484
485
486 <h3>Parameters</h3>
487 <ul>
488         
489         <li>
490           stat: A file.stat structure
491         </li>
492         
493 </ul>
494
495
496
497
498
499
500 <h3>Return value:</h3>
501 String containing the generated tag suitable for ETag headers
502
503
504
505 </dd>
506
507
508 </dl>
509
510
511
512
513
514 </div> <!-- id="content" -->
515
516 </div> <!-- id="main" -->
517
518 <div id="about">
519         <p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p>
520 </div> <!-- id="about" -->
521
522 </div> <!-- id="container" -->
523 </body>
524 </html>