Skip to content

Commit

Permalink
Write docs for cakephp/cakephp#17416
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Nov 16, 2023
1 parent c7b880e commit 46fcecb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions en/appendices/5-1-upgrade-guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ Http

- ``SecurityHeadersMiddleware::setPermissionsPolicy()`` was added. This method
adds the ability to define ``permissions-policy`` header values.
- ``Client`` now emits ``HttpClient.beforeSend`` and ``HttpClient.afterSend``
events when requests are sent. You can use these events to perform logging,
caching or collect telemetry.

Validation
----------
Expand Down
11 changes: 11 additions & 0 deletions en/core-libraries/httpclient.rst
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,17 @@ method::
]);
$http->addCookie(new Cookie('session', 'abc123'));

Client Events
=============

``Client`` will emit events when requests are sent. The
``HttpClient.beforeSend`` event is fired before a request is sent, and
``HttpClient.afterSend`` is fired after a request is sent. You can modify the
request, or set a response in a ``beforeSend`` listener. The ``afterSend`` event
is triggered for all requests, even those that have their responses set by
a ``beforeSend`` event.


.. _httpclient-response-objects:

Response Objects
Expand Down

0 comments on commit 46fcecb

Please sign in to comment.