diff options
author | Diego Nehab <diego@tecgraf.puc-rio.br> | 2005-11-20 08:56:19 +0000 |
---|---|---|
committer | Diego Nehab <diego@tecgraf.puc-rio.br> | 2005-11-20 08:56:19 +0000 |
commit | 5e09779c7f6b1710150d5a0f12d86ded7ede75c6 (patch) | |
tree | ffd2e2e7d918cc30015c89bd14122aa8cadb1546 /doc/http.html | |
parent | f20f4889bfe5a02cd9b77868b90cc8042352176a (diff) | |
download | luasocket-5e09779c7f6b1710150d5a0f12d86ded7ede75c6.tar.gz luasocket-5e09779c7f6b1710150d5a0f12d86ded7ede75c6.tar.bz2 luasocket-5e09779c7f6b1710150d5a0f12d86ded7ede75c6.zip |
In pre release mode!
Diffstat (limited to 'doc/http.html')
-rw-r--r-- | doc/http.html | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/doc/http.html b/doc/http.html index 096ab2b..9d80c23 100644 --- a/doc/http.html +++ b/doc/http.html | |||
@@ -209,11 +209,16 @@ Here are a few examples with the simple interface: | |||
209 | 209 | ||
210 | <pre class=example> | 210 | <pre class=example> |
211 | -- load the http module | 211 | -- load the http module |
212 | http = require("socket.http") | 212 | local io = require("io") |
213 | local http = require("socket.http") | ||
214 | local ltn12 = require("ltn12") | ||
213 | 215 | ||
214 | -- connect to server "www.tecgraf.puc-rio.br" and retrieves this manual | 216 | -- connect to server "www.cs.princeton.edu" and retrieves this manual |
215 | -- file from "/luasocket/http.html" | 217 | -- file from "~diego/professional/luasocket/http.html" and print it to stdout |
216 | b = http.request("http://www.tecgraf.puc-rio.br/luasocket/http.html") | 218 | http.request{ |
219 | url = "http://www.cs.princeton.edu/~diego/professional/luasocket/http.html", | ||
220 | sink = ltn12.sink.file(io.stdout) | ||
221 | } | ||
217 | 222 | ||
218 | -- connect to server "www.example.com" and tries to retrieve | 223 | -- connect to server "www.example.com" and tries to retrieve |
219 | -- "/private/index.html". Fails because authentication is needed. | 224 | -- "/private/index.html". Fails because authentication is needed. |