aboutsummaryrefslogtreecommitdiff
path: root/doc/http.html
diff options
context:
space:
mode:
authorDiego Nehab <diego@tecgraf.puc-rio.br>2004-06-16 20:41:03 +0000
committerDiego Nehab <diego@tecgraf.puc-rio.br>2004-06-16 20:41:03 +0000
commitba2f0b8c6ba7fb3a26fa6d9676ee1aefe6d873cc (patch)
tree1a49ac4a3c74b9d3bf8e4220d4bf9c48641f3dbc /doc/http.html
parent0a4c1534f39511894728da193ab8225ad6022de9 (diff)
downloadluasocket-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.html28
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,
50The module exports functions that provide HTTP functionality in different 50The module exports functions that provide HTTP functionality in different
51levels of abstraction, from the simple 51levels 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
53LTN12 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
54even lower-level if you bother to look through the source code. 55even 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>
59To 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:
85headers = {<br> 87headers = {<br>
86&nbsp;&nbsp;field-1-name = <i>field-1-value</i>,<br> 88&nbsp;&nbsp;field-1-name = <i>field-1-value</i>,<br>
87&nbsp;&nbsp;field-2-name = <i>field-2-value</i>,<br> 89&nbsp;&nbsp;field-2-name = <i>field-2-value</i>,<br>
88&nbsp;&nbsp;field-3-name = <i>field-3-value</i>, 90&nbsp;&nbsp;field-3-name = <i>field-3-value</i>,<br>
89</tt></td></tr> 91&nbsp;&nbsp;...<br>
90<tr><td align=center><tt>
91&nbsp;&nbsp;...
92</tt></td></tr>
93<tr><td><tt>
94&nbsp;&nbsp;field-n-name = <i>field-n-value</i><br> 92&nbsp;&nbsp;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>
189http.<b>request{</b><br> 187http.<b>request{</b><br>
190&nbsp;&nbsp;url = <i>string</i>,<br> 188&nbsp;&nbsp;url = <i>string</i>,<br>
191&nbsp;&nbsp;[sink = <i>LTN12 sink</i>],]<br> 189&nbsp;&nbsp;[sink = <i>LTN12 sink</i>,]<br>
192&nbsp;&nbsp;[method = <i>string</i>,]<br> 190&nbsp;&nbsp;[method = <i>string</i>,]<br>
193&nbsp;&nbsp;[headers = <i>header-table</i>,]<br> 191&nbsp;&nbsp;[headers = <i>header-table</i>,]<br>
194&nbsp;&nbsp;[source = <i>LTN12 source</i>],<br> 192&nbsp;&nbsp;[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>
206The most important parameters are the <tt>url</tt> and the <em>simple</em> LTN12 <tt>sink</tt> that will receive the downloaded content. 204The 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.
207Any part of the <tt>url</tt> can be overridden by including 207Any part of the <tt>url</tt> can be overridden by including
208the appropriate field in the request table. 208the appropriate field in the request table.
209If authentication information is provided, the function 209If 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>
220source to provide the request body. If there
219is a body, you need to provide an appropriate "<tt>content-length</tt>" 221is a body, you need to provide an appropriate "<tt>content-length</tt>"
220request header field, or the function will attempt to send the body as 222request 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>
226pump step function used to move data.
223Defaults to the LTN12 <tt>pump.step</tt> function. 227Defaults 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