cs::HTTP - operate the HTTP protocol
use cs::HTTP;
This module implements functions and methods for dealing with HTTP connections.
200 Request fulfilled.
201 follows post - text is URI of new document
202 request accepted but not complete (may never be)
203 response is a private metaweb, not the original
204 request ok, but nothing to send back - client's browser should stay in the same spot
301 document has new permanent URI. Lines follow of the form:
B<URI>: I<url> I<comment>
302 document is currently elsewhere. Lines follow of the form:
B<URI:> I<url> I<comment>
303 document needs different method. Following is:
B<Method:> I<method> I<url>
I<body-section>
body-section is data for method.
304 response to conditional GET - document not modified, client should used cached version.
400 bad request
401 bad authorisation - text is auth scheme spec
402 payment required - text is payment scheme spec
403 request denied - authorisation won't help
404 no match for URI
500 undiagnosed server problem
501 facility not supported
502 load too high - try later
503 gateway timeout - subservices didn't respond in time
Convert all characters string not matching chptn into %xx escapes. If chptn is HTML, use [^!-~]|`` for the pattern.
Convert all %xx escapes in string into characters.
Return a cs::RFC822 header set to accompany a request for the cs::URL url, including cookie fields. The optional cs::URL srcurl is used for the Referer: field, defaulting to the environment variable HTTP_REFERER or failing that, url. The optional agent is used for the User-Agent: field, defaulting to the environment variable HTTP_USER_AGENT or failing that, ``$::cmd/1.0''.
Return an array of hashrefs representing cookies from the specified file. If cookiefile is omitted use the file specified by the environment variable $COOKIE_FILE or failing that $HOME/.netscape/cookies.txt.
Return a cs::Net::TCP object attached to the host:port specified (port defaults to 80, the standard HTTP port). If the optional isProxy flag is set the connection is taken to be to a web proxy.
Request the uri with the specified method. If supplied, hdrs are added to the headers sent with the request, superceding matching headers. If supplied, data is a cs::Source containing data to follow the headers. If supplied, version is an HTTP/n.n version string to use instead of the default HTTP/1.0.
Call the Request method a GET method specification.
Call the Request method for the specified uri with a POST method specification and the values in the hashref data attached as the data source.
cs::Net::TCP(3), cs::Port(3)
Cameron Simpson <cs@zip.com.au>