Class Message

Base class for other HTTP requests/responses

Defines some common helper methods, constants and properties.

Direct known subclasses

Cake\Network\Http\Request, Cake\Network\Http\Response
Namespace: Cake\Network\Http
Located at Network/Http/Message.php

Method Detail

_normalizeHeadersource protected

_normalizeHeader( string $name )

Normalize header names to Camel-Case form.

Parameters

string $name
The header name to normalize.

Returns

string
Normalized header name.

bodysource public

body( string|null $body null )

Get/set the body for the message.

Parameters

string|null $body optional null
The body for the request. Leave null for get

Returns

mixed
Either $this or the body value.

cookiessource public

cookies( )

Get all cookies

Returns

array
array

headerssource public

headers( )

Get all headers

Returns

array
array

versionsource public

version( )

Get the HTTP version used.

Returns

string
string

Constants summary

string METHOD_DELETE

HTTP DELETE method

'DELETE'
string METHOD_GET

HTTP GET method

'GET'
string METHOD_HEAD

HTTP HEAD method

'HEAD'
string METHOD_OPTIONS

HTTP OPTIONS method

'OPTIONS'
string METHOD_PATCH

HTTP PATCH method

'PATCH'
string METHOD_POST

HTTP POST method

'POST'
string METHOD_PUT

HTTP PUT method

'PUT'
string METHOD_TRACE

HTTP TRACE method

'TRACE'
integer STATUS_ACCEPTED

HTTP 202 code

202
integer STATUS_CREATED

HTTP 201 code

201
integer STATUS_FOUND

HTTP 302 code

302
integer STATUS_MOVED_PERMANENTLY

HTTP 301 code

301
integer STATUS_OK

HTTP 200 code

200
integer STATUS_SEE_OTHER

HTTP 303 code

303
integer STATUS_TEMPORARY_REDIRECT

HTTP 307 code

307

Properties summary

$_cookiessource

protected array

The array of cookies in the response.

[]

$_headerssource

protected array

The array of headers in the response.

[]

$_versionsource

protected string

HTTP Version being used.

'1.1'

© 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.Message.html