News : The level of daily SPAM has reached insane proportions, all registrations are now manual. I ask you to send me an e-mail (john (at) murga (dot) org), to confirm that you want me to create an account for you.

Post Reply  Post Thread 
http server responses
Author Message
Senior Member

Posts: 522
Group: Registered
Joined: Apr 2007
Status: Offline
Reputation: 5
Post: #1
http server responses

I was just curious to discover what kind of data can be retrieved from a web server, and what uses that data has. First test, a table containing the error codes listed at W3C. I might dip into finding uses for the headers next, although a brief search shows that there are a lot of them.

#!/usr/bin/env murgaLua


[400]="Bad Request",
[404]="Not Found",
[405]="Method Not Allowed",
[406]="Not Acceptable",
[407]="Proxy Authentication Required",
[408]="Request Timeout",
[411]="Length Required",
[412]="Precondition Failed",
[413]="Request Entity Too Large",
[414]="Request-URI Too Long",
[415]="Unsupported Media Type",
[416]="Requested Range Not Satisfiable",
[417]="Expectation Failed",
[500]="Internal Server Error",
[501]="Not Implemented",
[502]="Bad Gateway",
[503]="Service Unavailable",
[504]="Gateway Timeout",
[505]="HTTP Version Not Supported"

-- change this to whatever url you want to test

print("Code returned by server:\n"..code)
if errors[code] then print("Error: "..errors[code]) end
for k,v in pairs(header) do print(k,v) end
print("Document text:\n"..body)

01-11-2010 05:46 AM
Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: