HTTP Response class
Use to hold HTTP responses (status line, headers, and message body).
This class is based on Response.pm <http://search.cpan.org/author/GAAS/libwww-perl-5.65/ lib/HTTP/Response.pm> from the libwww-perl collection <http://www.linpro.no/lwp/>.
Example:
1 $request =& new HTTP_Response(200, 'OK');
TODO:
Located in Program_Root/HTTP_Response.php (line 46)
HTTP_Message | --HTTP_Response
Constructor
Example:
1 $response =& new HTTP_Response(200, 'OK');
headers object
message body
As string - returns HTTP response message as a string.
Clone
Returns a copy. The previous response (if set) will not be copied.
Get Base URL
Returns a URL object, the base URL is taken from one of the following 3 headers:
Content-Base - HTTP/1.1 RFC 2068 (old spec)
RFC 2616 says "Content-Base was deleted from the specification:
it was not implemented widely, and there is no simple, safe way to
introduce it without a robust extension mechanism."
Content-Location - HTTP/1.1 RFC 2616
Base - RFC 1808 Section 3.1
If neither of these headers contain a value, the request URL will be used. If the value found in these headers is a relative URL, it will be set as relative to the request URL.
Get previous response object (returns reference)
Example:
1 $prev_response =& $response->get_previous();
Get request object (returns reference)
Example:
1 $request =& $response->get_request();
Get status line
Returns status line as defined in RFC 2616 Section 6.1: Status-Line = HTTP-Version SP Status-Code SP Reason-Phrase CRLF
Is client error
This class of status code is intended for cases in which the client seems to have erred.
Is error
Returns true for both client or server error status codes.
Is info
This class of status code indicates a provisional response which can't have any content.
Is redirect
This class of status code indicates that further action needs to be taken by the user agent in order to fulfill the request.
Is server error
This class of status codes is intended for cases in which the server is aware that it has erred or is incapable of performing the request.
Set previous response object reference
passed by reference
Set reason phrase
Set request object reference
passed by reference
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:32 +0100 by phpDocumentor 1.2.0