HTTP Request class
Use to hold HTTP requests (request line, headers, and message body).
This class is based on Request.pm <http://search.cpan.org/author/GAAS/libwww-perl-5.65/lib/HTTP/Request.pm> from the libwww-perl collection <http://www.linpro.no/lwp/>.
Example:
1 $request =& new HTTP_Request('GET', new URL('http://www.k1m.com/'));
TODO:
Located in Program_Root/HTTP_Request.php (line 45)
HTTP_Message | --HTTP_Request
Method
Request-URI (used only in Request-Line)
URL - instance of URL class
Inherited from HTTP_Message
HTTP_Message::$headers
Constructor
Example:
1 $request =& new HTTP_Request('GET', new URL('http://www.k1m.com/'));
either URL string, or URL object
headers object
message body
As string
Returns HTTP request message as a string. Accepts 1 argument, this is specify whether the request body should be included in the resulting string, if unspecified, the body will be included. Note: body is only included if it is a string.
This should only be used for debugging, how the actual request will look depends on other factors which the Request object will not be aware of. For example, RFC 2616 (HTTP/1.1) Section 5.1.2 states "The absoluteURI form is REQUIRED when the request is being made to a proxy." The Request object will not know if the request will be passing through a proxy or not, so it's best to build the request message at a time when this information is available.
specify whether to include body or not, if unspecified, body will be included.
Authorization: Basic
Clone - return a copy
Get request-uri.
See note in set_request_uri() to see why this might be used.
Get URL string (calls the as_string() method of the URL class)
Proxy-Authorization: Basic
Set request-uri
NOTE: The Request-Line is built differently depending on certain factors. This method allows a complete representation of a request to be held, only useful in situations when the request object is going to be treated as is.
Set URL
Example:
or
1 $url = 'http://www.medialens.org';
2 $request->set_url($url);
1 $url =& new URL('http://www.medialens.org');
2 $request->set_url($url);
string or URL object
Inherited From HTTP_Message
HTTP_Message::HTTP_Message()
HTTP_Message::append_body()
HTTP_Message::as_string()
HTTP_Message::clone()
HTTP_Message::get_body()
HTTP_Message::get_body_ref()
HTTP_Message::get_headers()
HTTP_Message::get_headers_ref()
HTTP_Message::get_header_array()
HTTP_Message::get_header_string()
HTTP_Message::get_protocol()
HTTP_Message::has_body()
HTTP_Message::init_header()
HTTP_Message::push_header()
HTTP_Message::remove_header()
HTTP_Message::set_body()
HTTP_Message::set_header()
HTTP_Message::set_headers()
HTTP_Message::set_protocol()
Documention generated on Wed, 16 Jul 2003 01:03:28 +0100 by phpDocumentor 1.2.0