Property | Type | Description | |
---|---|---|---|
$auth | mixed | Any array with a 'nonce' attribute implies Digest authentication; all other non-empty values for imply Basic authentication. | |
$cookies | array | Cookies. | |
$method | string | The method of the request, typically one of the following: GET, POST, PUT, DELETE, OPTIONS, HEAD, TRACE or CONNECT. | |
$query | array | Key/value pairs found encoded in the URL after the '?'. |
Property | Type | Description | |
---|---|---|---|
$_formats | array | An array of closures representing various formats this object can be exported to. |
Method | Description | |
---|---|---|
__construct ( array $config = [] ) : void | Constructor. Adds config values to the public properties when a new object is created. | |
__toString ( ) : string | Magic method to convert object to string. | |
body ( mixed $data = null, array $options = [] ) : array | Compile the HTTP message body, optionally encoding 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. | |
queryString ( array $params = [], string $format = null ) : string | Get the full query string queryString. | |
to ( string $format, array $options = [] ) : mixed | Converts the data in the record set to a different format, i.e. an array. Available options: array, URL, stream context configuration, or string. |
Method | Description | |
---|---|---|
_cookies ( ) : string | Render Cookie header, urlencoding invalid characters. | |
_parseCookies ( string $header ) | Parse Cookie header. |
public __construct ( array $config = [] ) : void | ||
$config | array | The available configuration options are the following. Further options are inherited from the parent classes. - `'method'` _string_: Defaults to `'GET'`. - `'path'` _string_: Defaults to `null`. - `'query'` _array_: Defaults to `array()`. - `'cookies'` _array_: Defaults to `array()`. - `'type'` _string_: Defaults to `null`. - `'auth'` _mixed_: Defaults to `null`. - `'proxy'` _string_: Defaults to `null`. - `'ignoreErrors'` _boolean_: Defaults to `true`. - `'followLocation'` _boolean_: Defaults to `true`. |
return | void |
public __toString ( ) : string | ||
return | string |
protected _parseCookies ( string $header ) | ||
$header | string | `Cookie` header. |
public to ( string $format, array $options = [] ) : mixed | ||
$format | string | Format to convert to. Should be either `'url'`, which returns a string representation of the URL that this request points to, or `'context'`, which returns an array usable with PHP's `stream_context_create()` function. For more available formats, see the parent method, `lithium\net\Message::to()`. |
$options | array | Allows overriding of specific portions of the URL, as follows. These options should only be specified if you intend to replace the values that are already in the `Request` object. - `'scheme'` _string_: The protocol scheme of the URL. - `'method'` _string_: If applicable, the HTTP method to use in the request. Mainly applies to the `'context'` format. - `'host'` _string_: The host name the request is pointing at. - `'port'` _string_: The host port, if any. - `'path'` _string_: The URL path. - `'query'` _mixed_: The query string of the URL as a string or array. - `'auth'` _string_: Authentication information. See the constructor for details. - `'content'` _string_: The body of the request. - `'headers'` _array_: The request headers. - `'version'` _string_: The HTTP version of the request, where applicable. |
return | mixed | Varies; see the `$format` parameter for possible return values. |
protected array $_formats | ||
return | array |
public mixed $auth | ||
return | mixed |
public string $method | ||
return | string |
public array $query | ||
return | array |