Skip to content

Commit 4155cc2

Browse files
authored
use the right method when dealing with promises
sendRequest() returns a response, not a promise, and we can't use then() on a response
1 parent 8548427 commit 4155cc2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

http_client.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1291,7 +1291,7 @@ Then you're ready to go::
12911291

12921292
$httpClient = new HttplugClient();
12931293
$request = $httpClient->createRequest('GET', 'https://my.api.com/');
1294-
$promise = $httpClient->sendRequest($request)
1294+
$promise = $httpClient->sendAsyncRequest($request)
12951295
->then(
12961296
function (ResponseInterface $response) {
12971297
echo 'Got status '.$response->getStatusCode();

0 commit comments

Comments
 (0)