Implements methods for HTTP requests.
Used by Cake\Network\Http\Client to contain request information for making requests.
Cake\Network\Http\Request METHOD_DELETE, METHOD_GET, METHOD_HEAD, METHOD_OPTIONS, METHOD_PATCH, METHOD_POST, METHOD_PUT, METHOD_TRACE, STATUS_ACCEPTED, STATUS_CREATED, STATUS_FOUND, STATUS_MOVED_PERMANENTLY, STATUS_OK, STATUS_SEE_OTHER, STATUS_TEMPORARY_REDIRECT $_body protected mixed$_headers protected array$_method protected string$_url protected stringcookie( 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 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 method( string|null $method null )
Get/Set the HTTP method.
$method optional null Cake\Core\Exception\Exceptionurl( string|null $url null )
Get/Set the url for the request.
$url optional null version( string|null $version null )
Get/Set HTTP version.
$version optional null Cake\Network\Http\Message::version() _normalizeHeader( string $name )
Normalize header names to Camel-Case form.
$name body( string|null $body null )
Get/set the body for the message.
$body optional null protected array
Headers to be sent.
[
'Connection' => 'close',
'User-Agent' => 'CakePHP'
]
© 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.2/class-Cake.Network.Http.Request.html