Skip to content

Commit 46fcecb

Browse files
committed
Write docs for cakephp/cakephp#17416
1 parent c7b880e commit 46fcecb

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

en/appendices/5-1-upgrade-guide.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ Http
1414

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

1821
Validation
1922
----------

en/core-libraries/httpclient.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,17 @@ method::
358358
]);
359359
$http->addCookie(new Cookie('session', 'abc123'));
360360

361+
Client Events
362+
=============
363+
364+
``Client`` will emit events when requests are sent. The
365+
``HttpClient.beforeSend`` event is fired before a request is sent, and
366+
``HttpClient.afterSend`` is fired after a request is sent. You can modify the
367+
request, or set a response in a ``beforeSend`` listener. The ``afterSend`` event
368+
is triggered for all requests, even those that have their responses set by
369+
a ``beforeSend`` event.
370+
371+
361372
.. _httpclient-response-objects:
362373

363374
Response Objects

0 commit comments

Comments
 (0)