Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions en/core-libraries/httpclient.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ If you have created a PSR-7 request object you can send it using
'http://example.com/search',
ClientRequest::METHOD_GET
);
$client = new Client();
$response = $client->sendRequest($request);
$http = new Client();
$response = $http->sendRequest($request);

Creating Multipart Requests with Files
======================================
Expand Down Expand Up @@ -477,7 +477,7 @@ instead. You can force select a transport adapter using a constructor option::

use Cake\Http\Client\Adapter\Stream;

$client = new Client(['adapter' => Stream::class]);
$http = new Client(['adapter' => Stream::class]);

Events
======
Expand All @@ -489,6 +489,8 @@ caching, logging etc.
HttpClient.beforeSend
---------------------

::

// Somewhere before calling one of the HTTP client's methods which makes a request
$http->getEventManager()->on(
'HttpClient.beforeSend',
Expand All @@ -512,6 +514,8 @@ HttpClient.beforeSend
HttpClient.afterSend
---------------------

::

// Somewhere before calling one of the HTTP client's methods which makes a request
$http->getEventManager()->on(
'HttpClient.afterSend',
Expand Down