Class EasyRdf_Http_Response

Description

Class that represents an HTTP 1.0 / 1.1 response message.

Located in /EasyRdf/Http/Response.php (line 50)


	
			
Method Summary
static string decodeChunkedBody (string $body)
static EasyRdf_Http_Response fromString (string $responseStr)
object EasyRdf_Http_Response __construct (int $status, array $headers, [string $body = null], [string $version = '1.1'], [string $message = null])
string asString ([string $br = "\n"])
string getBody ()
string|array|null getHeader (string$header $header)
array getHeaders ()
string getHeadersAsString ([ $statusLine = true], [string $br = "\n"], boolean $status_line)
string getMessage ()
string getRawBody ()
int getStatus ()
string getVersion ()
boolean isError ()
boolean isRedirect ()
boolean isSuccessful ()
string __toString ()
Methods
static method decodeChunkedBody (line 321)

Decode a "chunked" transfer-encoded body and return the decoded text

  • access: public
static string decodeChunkedBody (string $body)
  • string $body
static method fromString (line 266)

Create an EasyRdf_Http_Response object from a HTTP response string

  • access: public
static EasyRdf_Http_Response fromString (string $responseStr)
  • string $responseStr
Constructor __construct (line 92)

Constructor.

  • access: public
object EasyRdf_Http_Response __construct (int $status, array $headers, [string $body = null], [string $version = '1.1'], [string $message = null])
  • int $status: HTTP Status code
  • array $headers: The HTTP response headers
  • string $body: The content of the response
  • string $version: The HTTP Version (1.0 or 1.1)
  • string $message: The HTTP response Message
asString (line 348)

Get the entire response as string

  • access: public
string asString ([string $br = "\n"])
  • string $br: Line breaks (eg. "\n", "\r\n", "
    ")
getBody (line 164)

Get the response body as string

  • access: public
string getBody ()
getHeader (line 220)

Get a specific header as string, or null if it is not set

  • access: public
string|array|null getHeader (string$header $header)
  • string$header $header
getHeaders (line 209)

Get the response headers

  • access: public
array getHeaders ()
getHeadersAsString (line 237)

Get all headers as string

  • access: public
string getHeadersAsString ([ $statusLine = true], [string $br = "\n"], boolean $status_line)
  • boolean $status_line: Whether to return the first status line (IE "HTTP 200 OK")
  • string $br: Line breaks (eg. "\n", "\r\n", "
    ")
  • $statusLine
getMessage (line 154)

Return a message describing the HTTP response code (Eg. "OK", "Not Found", "Moved Permanently")

  • access: public
string getMessage ()
getRawBody (line 189)

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.

  • access: public
string getRawBody ()
getStatus (line 143)

Get the HTTP response status code

  • access: public
int getStatus ()
getVersion (line 199)

Get the HTTP version of the response

  • access: public
string getVersion ()
isError (line 123)

Check whether the response is an error

  • access: public
boolean isError ()
isRedirect (line 133)

Check whether the response is a redirection

  • access: public
boolean isRedirect ()
isSuccessful (line 113)

Check whether the response in successful

  • access: public
boolean isSuccessful ()
__toString (line 358)

Implements magic __toString()

  • access: public
string __toString ()

Documentation generated on Wed, 16 Jan 2013 19:16:38 +0000 by phpDocumentor 1.4.4