CakePHP
  • Documentation
    • Book
    • API
    • Videos
    • Reporting Security Issues
    • Privacy Policy
    • Logos & Trademarks
  • Business Solutions
  • Swag
  • Road Trip
  • Team
  • Community
    • Community
    • Get Involved
    • Issues (Github)
    • Bakery
    • Featured Resources
    • Training
    • Meetups
    • My CakePHP
    • CakeFest
    • Newsletter
    • Linkedin
    • YouTube
    • Facebook
    • Twitter
    • Mastodon
    • Help & Support
    • Forum
    • Stack Overflow
    • IRC
    • Slack
    • Paid Support
CakePHP

C CakePHP 6.0 API

  • Project:
    • CakePHP
      • CakePHP
      • Authentication
      • Authorization
      • Chronos
      • Elastic Search
      • Queue
  • Version:
    • 6.0
      • 6.0
      • 5.4
      • 5.3
      • 5.2
      • 5.1
      • 5.0
      • 4.6
      • 4.5
      • 4.4
      • 4.3
      • 4.2
      • 4.1
      • 4.0
      • 3.10
      • 3.9
      • 3.8
      • 3.7
      • 3.6
      • 3.5
      • 3.4
      • 3.3
      • 3.2
      • 3.1
      • 3.0
      • 2.10
      • 2.9
      • 2.8
      • 2.7
      • 2.6
      • 2.5
      • 2.4
      • 2.3
      • 2.2
      • 2.1
      • 2.0
      • 1.3
      • 1.2

Namespaces

  • Global
  • Cake
    • AttributeResolver
    • Cache
    • Collection
    • Command
    • Console
    • Container
    • Controller
    • Core
    • Database
    • Datasource
    • Error
    • Event
    • Form
    • Http
    • I18n
    • Lock
    • Log
    • Mailer
    • Network
    • ORM
    • Routing
    • TestSuite
    • Utility
    • Validation
    • View

Namespace Client

Namespaces

  • Cake\Http\Client\Adapter
  • Cake\Http\Client\Auth
  • Cake\Http\Client\Exception

Interfaces

  • AdapterInterface

    Http client adapter interface.

Classes

  • ClientEvent

    Class Client Event

  • FormData

    Provides an interface for building multipart/form-encoded message bodies.

    Used by Http\Client to upload POST/PUT data and files.

  • FormDataPart

    Contains the data and behavior for a single part in a Multipart FormData request body.

    Added to Cake\Http\Client\FormData when sending data to a remote server.

  • Message

    Base class for other HTTP requests/responses

    Defines some common helper methods, constants and properties.

  • Request

    Implements methods for HTTP requests.

    Used by Cake\Http\Client to contain request information for making requests.

  • Response

    Implements methods for HTTP responses.

    All the following examples assume that $response is an instance of this class.

    Get header values

    Header names are case-insensitive, but normalized to Title-Case when the response is parsed.

    $val = $response->getHeaderLine('content-type');

    Will read the Content-Type header. You can get all set headers using:

    $response->getHeaders();

    Get the response body

    You can access the response body stream using:

    $content = $response->getBody();

    You can get the body string using:

    $content = $response->getStringBody();

    If your response body is in XML or JSON you can use special content type specific accessors to read the decoded data. JSON data will be returned as arrays, while XML data will be returned as SimpleXML nodes:

    // Get as XML
    $content = $response->getXml()
    // Get as JSON
    $content = $response->getJson()

    If the response cannot be decoded, null will be returned.

    Check the status code

    You can access the response status code using:

    $content = $response->getStatusCode();
  • ResponseStream

    A live HTTP response body. Read errors are reported when consuming the body.

OpenHub
Pingping
Linode
  • Business Solutions
  • Showcase
  • Documentation
  • Book
  • API
  • Videos
  • Reporting Security Issues
  • Privacy Policy
  • Logos & Trademarks
  • Community
  • Get Involved
  • Issues (Github)
  • Bakery
  • Featured Resources
  • Training
  • Meetups
  • My CakePHP
  • CakeFest
  • Newsletter
  • Linkedin
  • YouTube
  • Facebook
  • Twitter
  • Mastodon
  • Help & Support
  • Forum
  • Stack Overflow
  • IRC
  • Slack
  • Paid Support

Generated using CakePHP API Docs