Skip to content

Commit 2835b12

Browse files
authored
Merge pull request #7770 from cakephp/http-client-consistency
Make http client variable consistent
2 parents f2d052a + 14b46a0 commit 2835b12

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

en/core-libraries/httpclient.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ If you have created a PSR-7 request object you can send it using
5959
'http://example.com/search',
6060
ClientRequest::METHOD_GET
6161
);
62-
$client = new Client();
63-
$response = $client->sendRequest($request);
62+
$http = new Client();
63+
$response = $http->sendRequest($request);
6464

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

478478
use Cake\Http\Client\Adapter\Stream;
479479

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

482482
Events
483483
======
@@ -489,6 +489,8 @@ caching, logging etc.
489489
HttpClient.beforeSend
490490
---------------------
491491

492+
::
493+
492494
// Somewhere before calling one of the HTTP client's methods which makes a request
493495
$http->getEventManager()->on(
494496
'HttpClient.beforeSend',
@@ -512,6 +514,8 @@ HttpClient.beforeSend
512514
HttpClient.afterSend
513515
---------------------
514516

517+
::
518+
515519
// Somewhere before calling one of the HTTP client's methods which makes a request
516520
$http->getEventManager()->on(
517521
'HttpClient.afterSend',

0 commit comments

Comments
 (0)