Open and execute an HTTP query.
HTTP.Query o=HTTP.Query(); void ok() { write("ok...\n"); write("%O\n", o->headers); exit(0); } void fail() { write("fail\n"); exit(0); } int main() { o->set_callbacks(ok, fail); o->async_request("pike.ida.liu.se", 80, "HEAD / HTTP/1.0"); return -1; }
HTTP.Query o=HTTP.Query();
void ok() { write("ok...\n"); write("%O\n", o->headers); exit(0); }
void fail() { write("fail\n"); exit(0); }
int main() { o->set_callbacks(ok, fail); o->async_request("pike.ida.liu.se", 80, "HEAD / HTTP/1.0"); return -1; }
int errno
Errno copied from the connection.
int ok
Tells if the connection is successfull.
mapping headers
Headers as a mapping. All header names are in lower case, for convinience.
string protocol
Protocol string, ie "HTTP/1.0".
"HTTP/1.0"
int status string status_desc
Status number and description (eg 200 and "ok").
200
"ok"
mapping hostname_cache
Set this to a global mapping if you want to use a cache, prior of calling *request().