Implements methods for HTTP requests.
Used by Cake\Network\Http\Client to contain request information for making requests.
cookie( string $name , string|null $value null )
Get/Set cookie values.
$request->cookie('session');
$request->cookie('session', '123456');
$request->cookie(['test' => 'value', 'split' => 'banana']);
$name
$value
optional null mixed
header( string|array|null $name null , string|null $value null )
Get/Set headers into the request.
You can get the value of a header, or set one/many headers. Headers are set / fetched in a case insensitive way.
$request->header('Content-Type');
$request->header('Content-Type', 'application/json');
$request->header(['Connection' => 'close', 'User-Agent' => 'CakePHP']);
$name
optional null $value
optional null mixed
method( string|null $method null )
Get/Set the HTTP method.
$method
optional null mixed
Cake\Core\Exception\Exception
url( string|null $url null )
Get/Set the url for the request.
$url
optional null mixed
version( string|null $version null )
Get/Set HTTP version.
$version
optional null mixed
Cake\Network\Http\Message::version()
_normalizeHeader( string $name )
Normalize header names to Camel-Case form.
$name
string
body( string|null $body null )
Get/set the body for the message.
$body
optional null mixed
© 2005–2016 The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
http://api.cakephp.org/3.1/class-Cake.Network.Http.Request.html