HttpMessage
class HttpMessage implements Countable, Serializable, Iterator (View source)
Constants
TYPE_NONE |
|
TYPE_REQUEST |
|
TYPE_RESPONSE |
|
Properties
protected | $type | ||
protected | $body | ||
protected | $requestMethod | ||
protected | $requestUrl | ||
protected | $responseStatus | ||
protected | $responseCode | ||
protected | $httpVersion | ||
protected | $headers | ||
protected | $parentMessage |
Methods
(PECL pecl_http >= 0.10.0)
HttpMessage constructor
(PECL pecl_http >= 0.10.0)
Get message body
(PECL pecl_http >= 0.14.0)
Set message body
(PECL pecl_http >= 1.1.0)
Get header
(PECL pecl_http >= 0.10.0)
Get message headers
(PECL pecl_http >= 0.10.0)
Set headers
(PECL pecl_http >= 0.10.0)
Add headers
(PECL pecl_http >= 0.10.0)
Get message type
(PECL pecl_http >= 0.10.0)
Set message type
No description
No description
(PECL pecl_http >= 0.10.0)
Get response code
(PECL pecl_http >= 0.10.0)
Set response code
(PECL pecl_http >= 0.23.0)
Get response status
(PECL pecl_http >= 0.23.0)
Set response status
(PECL pecl_http >= 0.10.0)
Get request method
(PECL pecl_http >= 0.10.0)
Set request method
(PECL pecl_http >= 0.21.0)
Get request URL
(PECL pecl_http >= 0.21.0)
Set request URL
(PECL pecl_http >= 0.10.0)
Get HTTP version
(PECL pecl_http >= 0.10.0)
Set HTTP version
(PECL pecl_http >= 1.0.0)
Guess content type
(PECL pecl_http >= 0.10.0)
Get parent message
(PECL pecl_http >= 0.10.0)
Send message
(PECL pecl_http >= 0.10.0)
Get string representation
(PECL pecl_http >= 0.22.0)
Create HTTP object regarding message type
Count elements of an object
String representation of object.
No description
Rewind the Iterator to the first element
Checks if current position is valid
Return the current element
Return the key of the current element
Move forward to next element
No description
(PECL pecl_http >= 1.4.0)
Create HttpMessage from string
(PECL pecl_http 0.10.0-1.3.3)
Create HttpMessage from string
(PECL pecl_http >= 1.5.0)
Create HttpMessage from environment
(PECL pecl_http >= 0.22.0)
Detach HttpMessage
(PECL pecl_http >= 0.23.0)
Reverse message chain
Details
__construct(string $message = null)
(PECL pecl_http >= 0.10.0)
HttpMessage constructor
string
getBody()
(PECL pecl_http >= 0.10.0)
Get message body
void
setBody(string $body)
(PECL pecl_http >= 0.14.0)
Set message body
string|null
getHeader(string $header)
(PECL pecl_http >= 1.1.0)
Get header
array
getHeaders()
(PECL pecl_http >= 0.10.0)
Get message headers
void
setHeaders(array $header)
(PECL pecl_http >= 0.10.0)
Set headers
void
addHeaders(array $headers, bool $append = null)
(PECL pecl_http >= 0.10.0)
Add headers
int
getType()
(PECL pecl_http >= 0.10.0)
Get message type
void
setType(int $type)
(PECL pecl_http >= 0.10.0)
Set message type
getInfo()
No description
setInfo($http_info)
No description
int|false
getResponseCode()
(PECL pecl_http >= 0.10.0)
Get response code
bool
setResponseCode(int $code)
(PECL pecl_http >= 0.10.0)
Set response code
string
getResponseStatus()
(PECL pecl_http >= 0.23.0)
Get response status
bool
setResponseStatus(string $status)
(PECL pecl_http >= 0.23.0)
Set response status
string|false
getRequestMethod()
(PECL pecl_http >= 0.10.0)
Get request method
bool
setRequestMethod(string $method)
(PECL pecl_http >= 0.10.0)
Set request method
string|false
getRequestUrl()
(PECL pecl_http >= 0.21.0)
Get request URL
bool
setRequestUrl(string $url)
(PECL pecl_http >= 0.21.0)
Set request URL
string
getHttpVersion()
(PECL pecl_http >= 0.10.0)
Get HTTP version
bool
setHttpVersion(string $version)
(PECL pecl_http >= 0.10.0)
Set HTTP version
string|false
guessContentType(string $magic_file, int $magic_mode = null)
(PECL pecl_http >= 1.0.0)
Guess content type
HttpMessage
getParentMessage()
(PECL pecl_http >= 0.10.0)
Get parent message
bool
send()
(PECL pecl_http >= 0.10.0)
Send message
string
toString(bool $include_parent = null)
(PECL pecl_http >= 0.10.0)
Get string representation
HttpRequest|HttpResponse|null
toMessageTypeObject()
(PECL pecl_http >= 0.22.0)
Create HTTP object regarding message type
int
count()
Count elements of an object
string|null
serialize()
String representation of object.
void
unserialize($serialized)
No description
void
rewind()
Rewind the Iterator to the first element
bool
valid()
Checks if current position is valid
mixed
current()
Return the current element
mixed
key()
Return the key of the current element
void
next()
Move forward to next element
string
__toString()
No description
static HttpMessage|null
factory(string $raw_message = null, string $class_name = null)
(PECL pecl_http >= 1.4.0)
Create HttpMessage from string
static HttpMessage|null
fromString(string $raw_message = null, string $class_name = null)
(PECL pecl_http 0.10.0-1.3.3)
Create HttpMessage from string
static HttpMessage|null
fromEnv(int $message_type, string $class_name = null)
(PECL pecl_http >= 1.5.0)
Create HttpMessage from environment
HttpMessage
detach()
(PECL pecl_http >= 0.22.0)
Detach HttpMessage
void
prepend(HttpMessage $message, bool $top = null)
(PECL pecl_http >= 0.22.0)
Prepend message(s)
HttpMessage
reverse()
(PECL pecl_http >= 0.23.0)
Reverse message chain