Class Message
Base class for other HTTP requests/responses
Defines some common helper methods, constants and properties.
Namespace: Cake\Http\Client
Constants
-
stringMETHOD_DELETE ¶'DELETE'HTTP DELETE method
-
stringMETHOD_GET ¶'GET'HTTP GET method
-
stringMETHOD_HEAD ¶'HEAD'HTTP HEAD method
-
stringMETHOD_OPTIONS ¶'OPTIONS'HTTP OPTIONS method
-
stringMETHOD_PATCH ¶'PATCH'HTTP PATCH method
-
stringMETHOD_POST ¶'POST'HTTP POST method
-
stringMETHOD_PUT ¶'PUT'HTTP PUT method
-
stringMETHOD_TRACE ¶'TRACE'HTTP TRACE method
-
intSTATUS_ACCEPTED ¶202HTTP 202 code
-
intSTATUS_CREATED ¶201HTTP 201 code
-
intSTATUS_FOUND ¶302HTTP 302 code
-
intSTATUS_MOVED_PERMANENTLY ¶301HTTP 301 code
-
intSTATUS_NON_AUTHORITATIVE_INFORMATION ¶203HTTP 203 code
-
intSTATUS_NO_CONTENT ¶204HTTP 204 code
-
intSTATUS_OK ¶200HTTP 200 code
-
intSTATUS_SEE_OTHER ¶303HTTP 303 code
-
intSTATUS_TEMPORARY_REDIRECT ¶307HTTP 307 code
Property Summary
Method Summary
-
body() public
Get/set the body for the message.
-
cookies() public
Get all cookies
-
headers() public deprecated
Get all headers
Method Detail
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
mixedEither $this or the body value.