lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


This is exactly what I wanted to know.

Thanks,

Sam.

-----Original Message-----
From: lua-bounces@bazar2.conectiva.com.br
[mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of Petite Abeille
Sent: 11 June 2008 18:33
To: Lua list
Subject: Re: crawling the web


On Jun 11, 2008, at 6:57 PM, s.gardner wrote:

> Attempt to call field 'http_get' (a nil value)

Assuming you are using LuaSocket [1], socket.http is what you are  
looking for:

local http = require( 'socket.http' )

local aResponse, aCode = http.request( aURL )

or

local aRequest = { method = 'HEAD', url = aLink, headers = { referer =  
aURL } }
local aResponse, aCode = http.request( aRequest )


[1] http://www.cs.princeton.edu/~diego/professional/luasocket