HTTP
PHP Manual

The HttpMessage class

Class synopsis

HttpMessage
HttpMessage implements Iterator , Countable , Serializable {
public void HttpMessage::addHeaders ( array $headers [, bool $append = FALSE ] )
public void HttpMessage::__construct ([ string $message ] )
public HttpMessage HttpMessage::detach ( void )
static public HttpMessage HttpMessage::factory ([ string $raw_message [, string $class_name = 'HttpMessage' ]] )
static public HttpMessage HttpMessage::fromEnv ( int $message_type [, string $class_name = 'HttpMessage' ] )
static public HttpMessage HttpMessage::fromString ([ string $raw_message [, string $class_name = 'HttpMessage' ]] )
public string HttpMessage::getBody ( void )
public string HttpMessage::getHeader ( string $header )
public array HttpMessage::getHeaders ( void )
public string HttpMessage::getHttpVersion ( void )
public HttpMessage HttpMessage::getParentMessage ( void )
public string HttpMessage::getRequestMethod ( void )
public string HttpMessage::getRequestUrl ( void )
public int HttpMessage::getResponseCode ( void )
public string HttpMessage::getResponseStatus ( void )
public int HttpMessage::getType ( void )
public string HttpMessage::guessContentType ( string $magic_file [, int $magic_mode = MAGIC_MIME ] )
public void HttpMessage::prepend ( HttpMessage $message [, bool $top = TRUE ] )
public HttpMessage HttpMessage::reverse ( void )
public bool HttpMessage::send ( void )
public void HttpMessage::setBody ( string $body )
public void HttpMessage::setHeaders ( array $headers )
public bool HttpMessage::setHttpVersion ( string $version )
public bool HttpMessage::setRequestMethod ( string $method )
public bool HttpMessage::setRequestUrl ( string $url )
public bool HttpMessage::setResponseCode ( int $code )
public bool HttpMessage::setResponseStatus ( string $status )
public void HttpMessage::setType ( int $type )
public HttpRequest|HttpResponse HttpMessage::toMessageTypeObject ( void )
public string HttpMessage::toString ([ bool $include_parent = FALSE ] )
}

Class Members

Properties

Instance Properties
Modifiers Type Name Description
protected int type message type
protected string body message body
protected float httpVersion HTTP protocol version
protected array headers message headers
protected string requestMethod request method name
protected requestUrl string request URL
protected int responseCode response code
protected string responseStatus response status message
protected HttpMessage parentMessage reference to parent message

Note: None of these default properties can be accessed by reference, array key/index notation nor be used in increment or decrement operations.

Predefined Constants

Type Name Description
int TYPE_NONE message has is of no specific type
int TYPE_REQUEST message is a request style HTTP message
int TYPE_RESPONSE message is a response style HTTP message

Table of Contents


HTTP
PHP Manual