Class Protocols.HTTP.Query
- Description
 Open and execute an HTTP query.
- Example
 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.lysator.liu.se", 80, "HEAD / HTTP/1.0"); return -1; }
- Variable errno
 intProtocols.HTTP.Query.errno- Description
 Errno copied from the connection or simulated for async operations.
- Note
 In Pike 7.8 and earlier hardcoded Linux values were used in async operations, 110 instead of
System.ETIMEDOUTand 113 instead ofSystem.EHOSTUNREACH.
- Variable headers
 mappingProtocols.HTTP.Query.headers- Description
 Headers as a mapping. All header names are in lower case, for convinience.
- Variable
host
Variable real_host
Variable port
 stringProtocols.HTTP.Query.host
stringProtocols.HTTP.Query.real_host
intProtocols.HTTP.Query.port- Description
 Connected host and port.
Used to detect whether keep-alive can be used.
- Variable hostname_cache
 mappingProtocols.HTTP.Query.hostname_cache- Description
 Set this to a global mapping if you want to use a cache, prior of calling *request().
- Variable ok
 intProtocols.HTTP.Query.ok- Description
 Tells if the connection is successfull.
- Variable protocol
 stringProtocols.HTTP.Query.protocol- Description
 Protocol string, ie
"HTTP/1.0".
- Variable
status
Variable status_desc
 intProtocols.HTTP.Query.status
stringProtocols.HTTP.Query.status_desc- Description
 Status number and description (eg
200and"ok").