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.
options is a mapping of options,
([ "login" : int|string login as this person number (get number from name) "create" : string create a new person and login with it "password" : string send this login password "invisible" : int(0..1) if set, login invisible advanced "port" : int(0..65535) server port (default is 4894) "whoami" : string present as this user (default is from uid/getpwent and hostname) ])
if "callback" are given, this function will be called when the text is created, with the text as first argument. Otherwise, the new text is returned.
options is a mapping that may contain:
([ "recpt" : Conference|array(Conference) recipient conferences "cc" : Conference|array(Conference) cc-recipient conferences "bcc" : Conference|array(Conference) bcc-recipient conferences * "comm_to" : Text|array(Text) what text(s) is commented "foot_to" : Text|array(Text) what text(s) is footnoted "anonymous" : int(0..1) send text anonymously ])
options is a mapping that may contain:
([ "recpt" : Conference recipient conference ])
The first method is a synchronous call. This will send the command, wait for the server to execute it, and then return the result.
The last two is asynchronous calls, returning the initialised request object.
variable int protocol_level variable string session_software variable string software_version Description of the connected server.
([ "login" : int|string login as this person number (get number from name) "password" : string send this login password "invisible" : int(0..1) if set, login invisible advanced "port" : int(0..65535) server port (default is 4894) "whoami" : string present as this user (default is from uid/getpwent and hostname) ])
variable int ok tells if the call is executed ok variable object error how the call failed The call is completed if (ok||error).
({ string hostname [0] hostname array(string) ip [1] ip number(s) array(string) ip [2] dns name(s) })