Extracted from Pike v7.6 release 61 at 2005-12-30.
pike.ida.liu.se
[Top]
Protocols
Protocols.HTTP
Protocols.HTTP.Query

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.ida.liu.se", 80, "HEAD / HTTP/1.0"); return -1; }



Variable errno

int errno

Description

Errno copied from the connection.


Variable ok

int ok

Description

Tells if the connection is successfull.


Variable headers

mapping headers

Description

Headers as a mapping. All header names are in lower case, for convinience.


Variable protocol

string protocol

Description

Protocol string, ie "HTTP/1.0".


int status
string status_desc

Description

Status number and description (eg 200 and "ok").


Variable hostname_cache

mapping hostname_cache

Description

Set this to a global mapping if you want to use a cache, prior of calling *request().