Sample usage:
// get the airbit logo into a file s:abhttp.Socket=abhttp.Socket("www.airbit.ch", 80); s.request(abhttp.GET, "/media/14/logo.jpg"); if s.handleResponse()=200 then print "Date:",s.fields["Date"]; f=io.create("airbit.jpg"); b=s.readContent(1024); // just any buffer size while b#null do io.write(f, b); b=s.readContent(1024) end; io.close(f) end; s.close()
url="http://www.airbit.ch/media/14/logo.jpg"; s:abhttp.Socket=abhttp.request(url, abhttp.GET); if s.handleResponse()=200 then ...
"host:port"
"http:"
"https:"
["host":host,"port":port,"path":path]