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 1
1
Promise
2
2
=======
3
3
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
+
6
7
The PHP-HTTP promise follows the `Promises/A+ `_ standard.
7
8
8
9
.. note ::
@@ -13,8 +14,11 @@ The PHP-HTTP promise follows the `Promises/A+`_ standard.
13
14
Asynchronous requests
14
15
---------------------
15
16
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::
18
22
19
23
$request = $messageFactory->createRequest('GET', 'http://php-http.org');
20
24
@@ -27,6 +31,9 @@ request with HTTPlug::
27
31
28
32
See :ref: `message-factory ` on how to use message factories.
29
33
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
+
30
37
Wait
31
38
----
32
39
You can’t perform that action at this time.
0 commit comments