Property | Type | Description | |
---|---|---|---|
$cookies | array | Cookies are stored as arrays of $name => $value where $value is an associative array or an array of associative arrays which contain at minimum a value key and optionally, expire, path, domain, secure, and/or httponly keys corresponding to the parameters of PHP setcookie(). | |
$encoding | string | Character encoding. | |
$status | array | Status code and message. |
Property | Type | Description | |
---|---|---|---|
$_statuses | array | Status codes. |
Method | Description | |
---|---|---|
__construct ( array $config = [] ) : void | Constructor. Adds config values to the public properties when a new object is created. | |
__toString ( ) : string | Return the response as a string. | |
body ( mixed $data = null, array $options = [] ) : array | Add data to or compile and return the HTTP message body, optionally decoding its parts according to content type. | |
cookies ( string $key = null, string $value = null ) : mixed | Add a cookie to header output, or return a single cookie or full cookie list. | |
digest ( ) : array | Looks at the WWW-Authenticate. Will return array of key/values if digest. | |
status ( string $key = null, string $status = null ) : string | Set and get the status for the response. |
Method | Description | |
---|---|---|
_cookies ( ) : array | Render Set-Cookie headers, urlencoding invalid characters. | |
_httpChunkedDecode ( string $body ) : string | Decodes content bodies transferred with HTTP chunked encoding. | |
_parseCookies ( array $headers ) | Parse Set-Cookie headers. | |
_parseMessage ( string $body ) : After | Accepts an entire HTTP message including headers and body, and parses it into a message body an array of headers, and the HTTP status. |
public __construct ( array $config = [] ) : void | ||
$config | array | The available configuration options are the following. Further options are inherited from the parent classes. - `'message'` _string_: Defaults to `null`. - `'status'` _mixed_: Defaults to `null`. - `'type'` _string_: Defaults to `null`. - `'cookies'` _array_: Defaults to `array()`. |
return | void |
public __toString ( ) : string | ||
return | string |
protected _httpChunkedDecode ( string $body ) : string | ||
$body | string | A chunked HTTP message body. |
return | string | Returns the value of `$body` with chunks decoded, but only if the value of the `Transfer-Encoding` header is set to `'chunked'`. Otherwise, returns `$body` unmodified. |
protected _parseCookies ( array $headers ) | ||
$headers | array | Array of `Set-Cookie` headers or `null` if no cookies to set. |
protected _parseMessage ( string $body ) : After | ||
$body | string | The full body of the message. |
return | After | parsing out other message components, returns just the message body. |
public status ( string $key = null, string $status = null ) : string | ||
$key | string | Optional. Set to `'code'` or `'message'` to return just the code or message of the status, otherwise returns the full status header. |
$status | string | The code or message of the status you wish to set. |
return | string | Returns the full HTTP status, with version, code and message or dending on $key just the code or message. |
public array $cookies | ||
return | array |