2
0

luci.http.protocol.conditionals.html 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556
  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. <body>
  10. <div id="container">
  11. <div id="product">
  12. <div id="product_logo"></div>
  13. <div id="product_name"><big><b></b></big></div>
  14. <div id="product_description"></div>
  15. </div> <!-- id="product" -->
  16. <div id="main">
  17. <div id="navigation">
  18. <h1>LuaDoc</h1>
  19. <ul>
  20. <li><a href="../index.html">Index</a></li>
  21. </ul>
  22. <!-- Module list -->
  23. <h1>Modules</h1>
  24. <ul>
  25. <li>
  26. <a href="../modules/luci.dispatcher.html">luci.dispatcher</a>
  27. </li>
  28. <li>
  29. <a href="../modules/luci.http.html">luci.http</a>
  30. </li>
  31. <li>
  32. <a href="../modules/luci.http.protocol.html">luci.http.protocol</a>
  33. </li>
  34. <li><strong>luci.http.protocol.conditionals</strong></li>
  35. <li>
  36. <a href="../modules/luci.http.protocol.date.html">luci.http.protocol.date</a>
  37. </li>
  38. <li>
  39. <a href="../modules/luci.http.protocol.mime.html">luci.http.protocol.mime</a>
  40. </li>
  41. <li>
  42. <a href="../modules/luci.i18n.html">luci.i18n</a>
  43. </li>
  44. <li>
  45. <a href="../modules/luci.ip.html">luci.ip</a>
  46. </li>
  47. <li>
  48. <a href="../modules/luci.ip.cidr.html">luci.ip.cidr</a>
  49. </li>
  50. <li>
  51. <a href="../modules/luci.json.html">luci.json</a>
  52. </li>
  53. <li>
  54. <a href="../modules/luci.jsonc.html">luci.jsonc</a>
  55. </li>
  56. <li>
  57. <a href="../modules/luci.jsonc.parser.html">luci.jsonc.parser</a>
  58. </li>
  59. <li>
  60. <a href="../modules/luci.model.ipkg.html">luci.model.ipkg</a>
  61. </li>
  62. <li>
  63. <a href="../modules/luci.model.uci.html">luci.model.uci</a>
  64. </li>
  65. <li>
  66. <a href="../modules/luci.rpcc.html">luci.rpcc</a>
  67. </li>
  68. <li>
  69. <a href="../modules/luci.rpcc.ruci.html">luci.rpcc.ruci</a>
  70. </li>
  71. <li>
  72. <a href="../modules/luci.sys.html">luci.sys</a>
  73. </li>
  74. <li>
  75. <a href="../modules/luci.sys.init.html">luci.sys.init</a>
  76. </li>
  77. <li>
  78. <a href="../modules/luci.sys.iptparser.html">luci.sys.iptparser</a>
  79. </li>
  80. <li>
  81. <a href="../modules/luci.sys.net.html">luci.sys.net</a>
  82. </li>
  83. <li>
  84. <a href="../modules/luci.sys.process.html">luci.sys.process</a>
  85. </li>
  86. <li>
  87. <a href="../modules/luci.sys.user.html">luci.sys.user</a>
  88. </li>
  89. <li>
  90. <a href="../modules/luci.sys.wifi.html">luci.sys.wifi</a>
  91. </li>
  92. <li>
  93. <a href="../modules/luci.util.html">luci.util</a>
  94. </li>
  95. <li>
  96. <a href="../modules/nixio.html">nixio</a>
  97. </li>
  98. <li>
  99. <a href="../modules/nixio.CHANGELOG.html">nixio.CHANGELOG</a>
  100. </li>
  101. <li>
  102. <a href="../modules/nixio.CryptoHash.html">nixio.CryptoHash</a>
  103. </li>
  104. <li>
  105. <a href="../modules/nixio.File.html">nixio.File</a>
  106. </li>
  107. <li>
  108. <a href="../modules/nixio.README.html">nixio.README</a>
  109. </li>
  110. <li>
  111. <a href="../modules/nixio.Socket.html">nixio.Socket</a>
  112. </li>
  113. <li>
  114. <a href="../modules/nixio.TLSContext.html">nixio.TLSContext</a>
  115. </li>
  116. <li>
  117. <a href="../modules/nixio.TLSSocket.html">nixio.TLSSocket</a>
  118. </li>
  119. <li>
  120. <a href="../modules/nixio.UnifiedIO.html">nixio.UnifiedIO</a>
  121. </li>
  122. <li>
  123. <a href="../modules/nixio.bin.html">nixio.bin</a>
  124. </li>
  125. <li>
  126. <a href="../modules/nixio.bit.html">nixio.bit</a>
  127. </li>
  128. <li>
  129. <a href="../modules/nixio.crypto.html">nixio.crypto</a>
  130. </li>
  131. <li>
  132. <a href="../modules/nixio.fs.html">nixio.fs</a>
  133. </li>
  134. </ul>
  135. <!-- File list -->
  136. </div><!-- id="navigation" -->
  137. <div id="content">
  138. <h1>Class <code>luci.http.protocol.conditionals</code></h1>
  139. <p></p>
  140. <h2>Functions</h2>
  141. <table class="function_list">
  142. <tr>
  143. <td class="name" nowrap><a href="#if_match">if_match</a>&nbsp;(req, stat)</td>
  144. <td class="summary">
  145. 14.24 / If-Match
  146. Test whether the given message object contains an "If-Match" header and
  147. compare it against the given stat object.</td>
  148. </tr>
  149. <tr>
  150. <td class="name" nowrap><a href="#if_modified_since">if_modified_since</a>&nbsp;(req, stat)</td>
  151. <td class="summary">
  152. 14.25 / If-Modified-Since
  153. Test whether the given message object contains an "If-Modified-Since" header
  154. and compare it against the given stat object.</td>
  155. </tr>
  156. <tr>
  157. <td class="name" nowrap><a href="#if_none_match">if_none_match</a>&nbsp;(req, stat)</td>
  158. <td class="summary">
  159. 14.26 / If-None-Match
  160. Test whether the given message object contains an "If-None-Match" header and
  161. compare it against the given stat object.</td>
  162. </tr>
  163. <tr>
  164. <td class="name" nowrap><a href="#if_range">if_range</a>&nbsp;(req, stat)</td>
  165. <td class="summary">
  166. 14.27 / If-Range
  167. The If-Range header is currently not implemented due to the lack of general
  168. byte range stuff in luci.http.protocol .</td>
  169. </tr>
  170. <tr>
  171. <td class="name" nowrap><a href="#if_unmodified_since">if_unmodified_since</a>&nbsp;(req, stat)</td>
  172. <td class="summary">
  173. 14.28 / If-Unmodified-Since
  174. Test whether the given message object contains an "If-Unmodified-Since"
  175. header and compare it against the given stat object.</td>
  176. </tr>
  177. <tr>
  178. <td class="name" nowrap><a href="#mk_etag">mk_etag</a>&nbsp;(stat)</td>
  179. <td class="summary">
  180. Implement 14.19 / ETag.</td>
  181. </tr>
  182. </table>
  183. <br/>
  184. <br/>
  185. <h2><a name="functions"></a>Functions</h2>
  186. <dl class="function">
  187. <dt><a name="if_match"></a><strong>if_match</strong>&nbsp;(req, stat)</dt>
  188. <dd>
  189. 14.24 / If-Match
  190. Test whether the given message object contains an "If-Match" header and
  191. compare it against the given stat object.
  192. <h3>Parameters</h3>
  193. <ul>
  194. <li>
  195. req: HTTP request message object
  196. </li>
  197. <li>
  198. stat: A file.stat object
  199. </li>
  200. </ul>
  201. <h3>Return values:</h3>
  202. <ol>
  203. <li>Boolean indicating whether the precondition is ok
  204. <li>Alternative status code if the precondition failed
  205. </ol>
  206. </dd>
  207. <dt><a name="if_modified_since"></a><strong>if_modified_since</strong>&nbsp;(req, stat)</dt>
  208. <dd>
  209. 14.25 / If-Modified-Since
  210. Test whether the given message object contains an "If-Modified-Since" header
  211. and compare it against the given stat object.
  212. <h3>Parameters</h3>
  213. <ul>
  214. <li>
  215. req: HTTP request message object
  216. </li>
  217. <li>
  218. stat: A file.stat object
  219. </li>
  220. </ul>
  221. <h3>Return values:</h3>
  222. <ol>
  223. <li>Boolean indicating whether the precondition is ok
  224. <li>Alternative status code if the precondition failed
  225. <li>Table containing extra HTTP headers if the precondition failed
  226. </ol>
  227. </dd>
  228. <dt><a name="if_none_match"></a><strong>if_none_match</strong>&nbsp;(req, stat)</dt>
  229. <dd>
  230. 14.26 / If-None-Match
  231. Test whether the given message object contains an "If-None-Match" header and
  232. compare it against the given stat object.
  233. <h3>Parameters</h3>
  234. <ul>
  235. <li>
  236. req: HTTP request message object
  237. </li>
  238. <li>
  239. stat: A file.stat object
  240. </li>
  241. </ul>
  242. <h3>Return values:</h3>
  243. <ol>
  244. <li>Boolean indicating whether the precondition is ok
  245. <li>Alternative status code if the precondition failed
  246. <li>Table containing extra HTTP headers if the precondition failed
  247. </ol>
  248. </dd>
  249. <dt><a name="if_range"></a><strong>if_range</strong>&nbsp;(req, stat)</dt>
  250. <dd>
  251. 14.27 / If-Range
  252. The If-Range header is currently not implemented due to the lack of general
  253. byte range stuff in luci.http.protocol . This function will always return
  254. false, 412 to indicate a failed precondition.
  255. <h3>Parameters</h3>
  256. <ul>
  257. <li>
  258. req: HTTP request message object
  259. </li>
  260. <li>
  261. stat: A file.stat object
  262. </li>
  263. </ul>
  264. <h3>Return values:</h3>
  265. <ol>
  266. <li>Boolean indicating whether the precondition is ok
  267. <li>Alternative status code if the precondition failed
  268. </ol>
  269. </dd>
  270. <dt><a name="if_unmodified_since"></a><strong>if_unmodified_since</strong>&nbsp;(req, stat)</dt>
  271. <dd>
  272. 14.28 / If-Unmodified-Since
  273. Test whether the given message object contains an "If-Unmodified-Since"
  274. header and compare it against the given stat object.
  275. <h3>Parameters</h3>
  276. <ul>
  277. <li>
  278. req: HTTP request message object
  279. </li>
  280. <li>
  281. stat: A file.stat object
  282. </li>
  283. </ul>
  284. <h3>Return values:</h3>
  285. <ol>
  286. <li>Boolean indicating whether the precondition is ok
  287. <li>Alternative status code if the precondition failed
  288. </ol>
  289. </dd>
  290. <dt><a name="mk_etag"></a><strong>mk_etag</strong>&nbsp;(stat)</dt>
  291. <dd>
  292. Implement 14.19 / ETag.
  293. <h3>Parameters</h3>
  294. <ul>
  295. <li>
  296. stat: A file.stat structure
  297. </li>
  298. </ul>
  299. <h3>Return value:</h3>
  300. String containing the generated tag suitable for ETag headers
  301. </dd>
  302. </dl>
  303. </div> <!-- id="content" -->
  304. </div> <!-- id="main" -->
  305. <div id="about">
  306. <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>
  307. </div> <!-- id="about" -->
  308. </div> <!-- id="container" -->
  309. </body>
  310. </html>