class EasyRdf_Http_Response
Class that represents an HTTP 1.0 / 1.1 response message.
Methods
object |
__construct(int $status, array $headers, string $body = null, string $version = '1.1', string $message = null)
Constructor. |
|
boolean |
isSuccessful()
Check whether the response in successful |
|
boolean |
isError()
Check whether the response is an error |
|
boolean |
isRedirect()
Check whether the response is a redirection |
|
int |
getStatus()
Get the HTTP response status code |
|
string |
getMessage()
Return a message describing the HTTP response code (Eg. |
|
string |
getBody()
Get the response body as string |
|
string |
getRawBody()
Get the raw response body (as transfered "on wire") as string |
|
string |
getVersion()
Get the HTTP version of the response |
|
array |
getHeaders()
Get the response headers |
|
string|array|null |
getHeader(string$header $header)
Get a specific header as string, or null if it is not set |
|
string |
getHeadersAsString(boolean $statusLine = true, string $br = '
')
Get all headers as string |
|
static EasyRdf_Http_Response |
fromString(string $responseStr)
Create an EasyRdfHttpResponse object from a HTTP response string |
|
static string |
decodeChunkedBody(string $body)
Decode a "chunked" transfer-encoded body and return the decoded text |
|
string |
asString(string $br = '
')
Get the entire response as string |
|
string |
__toString()
Implements magic __toString() |
Details
at line 91
public object
__construct(int $status, array $headers, string $body = null, string $version = '1.1', string $message = null)
Constructor.
at line 114
public boolean
isSuccessful()
Check whether the response in successful
at line 124
public boolean
isError()
Check whether the response is an error
at line 134
public boolean
isRedirect()
Check whether the response is a redirection
at line 144
public int
getStatus()
Get the HTTP response status code
at line 155
public string
getMessage()
Return a message describing the HTTP response code (Eg.
"OK", "Not Found", "Moved Permanently")
at line 165
public string
getBody()
Get the response body as string
at line 190
public string
getRawBody()
Get the raw response body (as transfered "on wire") as string
If the body is encoded (with Transfer-Encoding, not content-encoding - IE "chunked" body), gzip compressed, etc. it will not be decoded.
at line 200
public string
getVersion()
Get the HTTP version of the response
at line 210
public array
getHeaders()
Get the response headers
at line 221
public string|array|null
getHeader(string$header $header)
Get a specific header as string, or null if it is not set
at line 238
public string
getHeadersAsString(boolean $statusLine = true, string $br = '
')
Get all headers as string
at line 266
static public EasyRdf_Http_Response
fromString(string $responseStr)
Create an EasyRdfHttpResponse object from a HTTP response string
at line 319
static public string
decodeChunkedBody(string $body)
Decode a "chunked" transfer-encoded body and return the decoded text
at line 346
public string
asString(string $br = '
')
Get the entire response as string
at line 356
public string
__toString()
Implements magic __toString()