From f7579db9e830ef41f422a280d26c9077f48728e5 Mon Sep 17 00:00:00 2001 From: Diego Nehab Date: Sun, 20 Jun 2004 22:19:54 +0000 Subject: Fixing bugs... --- doc/http.html | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'doc/http.html') diff --git a/doc/http.html b/doc/http.html index a98915c..4780436 100644 --- a/doc/http.html +++ b/doc/http.html @@ -16,7 +16,7 @@
@@ -209,9 +209,9 @@ http = require("http") -- file from "/luasocket/http.html" b = http.request("http://www.tecgraf.puc-rio.br/luasocket/http.html") --- connect to server "www.tecgraf.puc-rio.br" and tries to retrieve --- "~diego/auth/index.html". Fails because authentication is needed. -b, c, h = http.request("http://www.tecgraf.puc-rio.br/~diego/auth/index.html") +-- connect to server "www.example.com" and tries to retrieve +-- "/private/index.html". Fails because authentication is needed. +b, c, h = http.request("http://www.example.com/private/index.html") -- b returns some useless page telling about the denied access, -- h returns authentication information -- and c returns with value 401 (Authentication Required) @@ -276,16 +276,16 @@ authentication is required. http = require("http") mime = require("mime") --- Connect to server "www.tecgraf.puc-rio.br" and tries to retrieve --- "~diego/auth/index.html", using the provided name and password to +-- Connect to server "www.example.com" and tries to retrieve +-- "/private/index.html", using the provided name and password to -- authenticate the request -b, c, h = http.request("http://diego:password@www.tecgraf.puc-rio.br/~diego/auth/index.html") +b, c, h = http.request("http://fulano:silva@www.example.com/private/index.html") -- Alternatively, one could fill the appropriate header and authenticate -- the request directly. r, c = http.request { - url = "http://www.tecgraf.puc-rio.br/~diego/auth/index.html", - headers = { authentication = "Basic " .. (mime.b64("diego:password")) } + url = "http://www.example.com/private/index.html", + headers = { authentication = "Basic " .. (mime.b64("fulano:silva")) } } -- cgit v1.2.3-55-g6feb
-LuaSocket +LuaSocket
Network support for the Lua language