aboutsummaryrefslogtreecommitdiff
path: root/doc/http.html
diff options
context:
space:
mode:
authorDiego Nehab <diego@tecgraf.puc-rio.br>2005-11-20 08:56:19 +0000
committerDiego Nehab <diego@tecgraf.puc-rio.br>2005-11-20 08:56:19 +0000
commit5e09779c7f6b1710150d5a0f12d86ded7ede75c6 (patch)
treeffd2e2e7d918cc30015c89bd14122aa8cadb1546 /doc/http.html
parentf20f4889bfe5a02cd9b77868b90cc8042352176a (diff)
downloadluasocket-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.html13
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
212http = require("socket.http") 212local io = require("io")
213local http = require("socket.http")
214local 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
216b = http.request("http://www.tecgraf.puc-rio.br/luasocket/http.html") 218http.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.