From 4155cc270069850a6281c5cb4566aa3d03d94bbd Mon Sep 17 00:00:00 2001 From: michel v Date: Tue, 20 Oct 2020 10:43:45 +0200 Subject: [PATCH] use the right method when dealing with promises sendRequest() returns a response, not a promise, and we can't use then() on a response --- http_client.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http_client.rst b/http_client.rst index 4db3784f853..7591152da85 100644 --- a/http_client.rst +++ b/http_client.rst @@ -1291,7 +1291,7 @@ Then you're ready to go:: $httpClient = new HttplugClient(); $request = $httpClient->createRequest('GET', 'https://my.api.com/'); - $promise = $httpClient->sendRequest($request) + $promise = $httpClient->sendAsyncRequest($request) ->then( function (ResponseInterface $response) { echo 'Got status '.$response->getStatusCode();