Lua : Fetch a webpage
snippet in lua

Lua : Fetch a webpage

user8841

local http=require'socket.http'
local body, statusCode, headers, statusText = http.request('http://w3.impa.br/~diego/software/luasocket/http.html')
print('statusCode ', statusCode)
print('statusText ', statusText)
print('headers ')
for index,value in pairs(headers) do
    print("\t",index, value)
end
print('body',body)