diff options
author | Diego Nehab <diego@tecgraf.puc-rio.br> | 2004-06-16 20:41:03 +0000 |
---|---|---|
committer | Diego Nehab <diego@tecgraf.puc-rio.br> | 2004-06-16 20:41:03 +0000 |
commit | ba2f0b8c6ba7fb3a26fa6d9676ee1aefe6d873cc (patch) | |
tree | 1a49ac4a3c74b9d3bf8e4220d4bf9c48641f3dbc /doc/http.html | |
parent | 0a4c1534f39511894728da193ab8225ad6022de9 (diff) | |
download | luasocket-ba2f0b8c6ba7fb3a26fa6d9676ee1aefe6d873cc.tar.gz luasocket-ba2f0b8c6ba7fb3a26fa6d9676ee1aefe6d873cc.tar.bz2 luasocket-ba2f0b8c6ba7fb3a26fa6d9676ee1aefe6d873cc.zip |
Fine tuning the manual...
Diffstat (limited to 'doc/http.html')
-rw-r--r-- | doc/http.html | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/doc/http.html b/doc/http.html index 0fc04cd..a621ec7 100644 --- a/doc/http.html +++ b/doc/http.html | |||
@@ -50,11 +50,13 @@ implementation conforms to the HTTP/1.1 standard, | |||
50 | The module exports functions that provide HTTP functionality in different | 50 | The module exports functions that provide HTTP functionality in different |
51 | levels of abstraction, from the simple | 51 | levels of abstraction, from the simple |
52 | <a href="#get"><tt>get</tt></a> function, through the generic | 52 | <a href="#get"><tt>get</tt></a> function, through the generic |
53 | LTN12 based <a href="#request"><tt>request</tt></a> function, down to | 53 | <a href="http://lua-users.org/wiki/FiltersSourcesAndSinks">LTN12</a> based |
54 | <a href="#request"><tt>request</tt></a> function, down to | ||
54 | even lower-level if you bother to look through the source code. | 55 | even lower-level if you bother to look through the source code. |
55 | </p> | 56 | </p> |
56 | 57 | ||
57 | <p class=description> To obtain the <tt>ftp</tt> namespace, run: | 58 | <p> |
59 | To obtain the <tt>http</tt> namespace, run: | ||
58 | </p> | 60 | </p> |
59 | 61 | ||
60 | <pre class=example> | 62 | <pre class=example> |
@@ -85,12 +87,8 @@ MIME headers are represented as a Lua table in the form: | |||
85 | headers = {<br> | 87 | headers = {<br> |
86 | field-1-name = <i>field-1-value</i>,<br> | 88 | field-1-name = <i>field-1-value</i>,<br> |
87 | field-2-name = <i>field-2-value</i>,<br> | 89 | field-2-name = <i>field-2-value</i>,<br> |
88 | field-3-name = <i>field-3-value</i>, | 90 | field-3-name = <i>field-3-value</i>,<br> |
89 | </tt></td></tr> | 91 | ...<br> |
90 | <tr><td align=center><tt> | ||
91 | ... | ||
92 | </tt></td></tr> | ||
93 | <tr><td><tt> | ||
94 | field-n-name = <i>field-n-value</i><br> | 92 | field-n-name = <i>field-n-value</i><br> |
95 | } | 93 | } |
96 | </tt></td></tr> | 94 | </tt></td></tr> |
@@ -188,7 +186,7 @@ Note: This function is also trivially implemented with the use of the | |||
188 | <p class=name id=request> | 186 | <p class=name id=request> |
189 | http.<b>request{</b><br> | 187 | http.<b>request{</b><br> |
190 | url = <i>string</i>,<br> | 188 | url = <i>string</i>,<br> |
191 | [sink = <i>LTN12 sink</i>],]<br> | 189 | [sink = <i>LTN12 sink</i>,]<br> |
192 | [method = <i>string</i>,]<br> | 190 | [method = <i>string</i>,]<br> |
193 | [headers = <i>header-table</i>,]<br> | 191 | [headers = <i>header-table</i>,]<br> |
194 | [source = <i>LTN12 source</i>],<br> | 192 | [source = <i>LTN12 source</i>],<br> |
@@ -203,7 +201,9 @@ Performs the generic HTTP request, controlled by a request table. | |||
203 | </p> | 201 | </p> |
204 | 202 | ||
205 | <p class=parameters> | 203 | <p class=parameters> |
206 | The most important parameters are the <tt>url</tt> and the <em>simple</em> LTN12 <tt>sink</tt> that will receive the downloaded content. | 204 | The most important parameters are the <tt>url</tt> and the <em>simple</em> |
205 | <a href="http://lua-users.org/wiki/FiltersSourcesAndSinks">LTN12</a> | ||
206 | <tt>sink</tt> that will receive the downloaded content. | ||
207 | Any part of the <tt>url</tt> can be overridden by including | 207 | Any part of the <tt>url</tt> can be overridden by including |
208 | the appropriate field in the request table. | 208 | the appropriate field in the request table. |
209 | If authentication information is provided, the function | 209 | If authentication information is provided, the function |
@@ -215,11 +215,15 @@ following: | |||
215 | <ul> | 215 | <ul> |
216 | <li><tt>method</tt>: The HTTP request method. Defaults to "GET"; | 216 | <li><tt>method</tt>: The HTTP request method. Defaults to "GET"; |
217 | <li><tt>headers</tt>: Any additional HTTP headers to send with the request; | 217 | <li><tt>headers</tt>: Any additional HTTP headers to send with the request; |
218 | <li><tt>source</tt>: <em>simple</em> LTN12 source to provide the request body. If there | 218 | <li><tt>source</tt>: <em>simple</em> |
219 | <a href="http://lua-users.org/wiki/FiltersSourcesAndSinks">LTN12</a> | ||
220 | source to provide the request body. If there | ||
219 | is a body, you need to provide an appropriate "<tt>content-length</tt>" | 221 | is a body, you need to provide an appropriate "<tt>content-length</tt>" |
220 | request header field, or the function will attempt to send the body as | 222 | request header field, or the function will attempt to send the body as |
221 | "<tt>chunked</tt>" (something few servers support). Defaults to the empty source; | 223 | "<tt>chunked</tt>" (something few servers support). Defaults to the empty source; |
222 | <li><tt>step</tt>: LTN12 pump step function used to move data. | 224 | <li><tt>step</tt>: |
225 | <a href="http://lua-users.org/wiki/FiltersSourcesAndSinks">LTN12</a> | ||
226 | pump step function used to move data. | ||
223 | Defaults to the LTN12 <tt>pump.step</tt> function. | 227 | Defaults to the LTN12 <tt>pump.step</tt> function. |
224 | <li><tt>proxy</tt>: The URL of a proxy server to use. Defaults to no proxy; | 228 | <li><tt>proxy</tt>: The URL of a proxy server to use. Defaults to no proxy; |
225 | <li><tt>redirect</tt>: Set to <tt><b>false</b></tt> to prevent the | 229 | <li><tt>redirect</tt>: Set to <tt><b>false</b></tt> to prevent the |