File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change 11Promise
22=======
33
4- When sending asynchronous HTTP requests, a promise is returned. The promise acts
5- as a proxy for the response or error result, which is not yet known.
4+ A promise represents a single result of an asynchronous operation.
5+ It is not necessarily available at a specific time, but should become in the future.
6+
67The PHP-HTTP promise follows the `Promises/A+ `_ standard.
78
89.. note ::
@@ -13,8 +14,11 @@ The PHP-HTTP promise follows the `Promises/A+`_ standard.
1314Asynchronous requests
1415---------------------
1516
16- Asynchronous requests enable non-blocking HTTP operations. To execute such a
17- request with HTTPlug::
17+ Asynchronous requests enable non-blocking HTTP operations.
18+ When sending asynchronous HTTP requests, a promise is returned. The promise acts
19+ as a proxy for the response or error result, which is not yet known.
20+
21+ To execute such a request with HTTPlug::
1822
1923 $request = $messageFactory->createRequest('GET', 'http://php-http.org');
2024
@@ -27,6 +31,9 @@ request with HTTPlug::
2731
2832See :ref: `message-factory ` on how to use message factories.
2933
34+ Although the promise itself is not restricted to resolve a specific result type,
35+ in HTTP context it resolves a PSR-7 ``Psr\Http\Message\ResponseInterface `` or fails with an ``Http\Client\Exception ``.
36+
3037Wait
3138----
3239
You can’t perform that action at this time.
0 commit comments