Class Message

Base class for other HTTP requests/responses

Defines some common helper methods, constants and properties.

Namespace: Cake\Http\Client

Constants summary

  • string
    METHOD_DELETE
    'DELETE'
  • string
    METHOD_GET
    'GET'
  • string
    METHOD_HEAD
    'HEAD'
  • string
    METHOD_OPTIONS
    'OPTIONS'
  • string
    METHOD_PATCH
    'PATCH'
  • string
    METHOD_POST
    'POST'
  • string
    METHOD_PUT
    'PUT'
  • string
    METHOD_TRACE
    'TRACE'
  • int
    STATUS_ACCEPTED
    202
  • int
    STATUS_CREATED
    201
  • int
    STATUS_FOUND
    302
  • int
    STATUS_MOVED_PERMANENTLY
    301
  • int
    STATUS_NON_AUTHORITATIVE_INFORMATION
    203
  • int
    STATUS_NO_CONTENT
    204
  • int
    STATUS_OK
    200
  • int
    STATUS_SEE_OTHER
    303
  • int
    STATUS_TEMPORARY_REDIRECT
    307

Properties summary

  • $_body protected
    string|null

    Body for the message.

  • $_cookies protected
    array

    The array of cookies in the response.

  • $headers public
    array

Method Summary

Method Detail

body() public

body(mixed $body)

Get/set the body for the message.

Parameters

string|null $body optional

The body for the request. Leave null for get

Returns

mixed

Either $this or the body value.

cookies() public

cookies()

Get all cookies

Returns

array

headers() public

headers()

Get all headers

Returns

array

Property Detail

$_body protected

Body for the message.

Type

string|null

$_cookies protected

The array of cookies in the response.

Type

array

$headers public

Type

array

© 2005–present 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.
https://api.cakephp.org/3.9/class-Cake.Http.Client.Message.html