Class Message
Base class for other HTTP requests/responses
Defines some common helper methods, constants and properties.
Namespace: Cake\Network\Http
Constants
-
string
METHOD_DELETE ¶'DELETE'
HTTP DELETE method
-
string
METHOD_GET ¶'GET'
HTTP GET method
-
string
METHOD_HEAD ¶'HEAD'
HTTP HEAD method
-
string
METHOD_OPTIONS ¶'OPTIONS'
HTTP OPTIONS method
-
string
METHOD_PATCH ¶'PATCH'
HTTP PATCH method
-
string
METHOD_POST ¶'POST'
HTTP POST method
-
string
METHOD_PUT ¶'PUT'
HTTP PUT method
-
string
METHOD_TRACE ¶'TRACE'
HTTP TRACE method
-
int
STATUS_ACCEPTED ¶202
HTTP 202 code
-
int
STATUS_CREATED ¶201
HTTP 201 code
-
int
STATUS_FOUND ¶302
HTTP 302 code
-
int
STATUS_MOVED_PERMANENTLY ¶301
HTTP 301 code
-
int
STATUS_OK ¶200
HTTP 200 code
-
int
STATUS_SEE_OTHER ¶303
HTTP 303 code
-
int
STATUS_TEMPORARY_REDIRECT ¶307
HTTP 307 code
Property Summary
Method Summary
-
_normalizeHeader() protected
Normalize header names to Camel-Case form.
-
body() public
Get/set the body for the message.
-
cookies() public
Get all cookies
-
headers() public
Get all headers
-
version() public
Get the HTTP version used.
Method Detail
_normalizeHeader() ¶ protected
_normalizeHeader(string $name): string
Normalize header names to Camel-Case form.
Parameters
-
string
$name The header name to normalize.
Returns
string
body() ¶ public
body(string|null $body = null): mixed
Get/set the body for the message.
Parameters
-
string|null
$body optional The body for the request. Leave null for get
Returns
mixed