request_ok(object httpquery,...extra args) will be called when connection is complete, and headers are parsed.
request_fail(object httpquery,...extra args) is called if the connection fails.
variable int ok Tells if the connection is successfull. variable int errno Errno copied from the connection.
variable mapping headers Headers as a mapping. All header names are in lower case, for convinience.
variable string protocol Protocol string, ie "HTTP/1.0".
variable int status variable string status_desc Status number and description (ie, 200 and "ok").
variable mapping hostname_cache Set this to a global mapping if you want to use a cache, prior of calling *request().
variable mapping async_dns Set this to an array of Protocols.DNS.async_clients, if you wish to limit the number of outstanding DNS requests. Example: async_dns=allocate(20,Protocols.DNS.async_client)();
The query is executed in a background thread; call '() in this object to wait for the request to complete.
'query' is the first line sent to the HTTP server; for instance "GET /index.html HTTP/1.1".
headers will be encoded and sent after the first line, and data will be sent after the headers.
object(pseudofile) file() object(pseudofile) file(mapping newheaders,void|mapping removeheaders) object(pseudofile) datafile(); Gives back a pseudo-file object, with the method read() and close(). This could be used to copy the file to disc at a proper tempo.
datafile() doesn't give the complete request, just the data.
newheaders, removeheaders is applied as: (oldheaders|newheaders))-removeheaders Make sure all new and remove-header indices are lower case.
void async_fetch(function done_callback); Fetch all data in background.