Converts the data in the record set to a different format, i.e. an array. Available
options: array, URL, stream context configuration, or string.
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. |
리턴 | mixed | Varies; see the `$format` parameter for possible return values. |