File tree Expand file tree Collapse file tree 3 files changed +36
-42
lines changed Expand file tree Collapse file tree 3 files changed +36
-42
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
- Introduction to HTTPlug
2
- =======================
1
+ HTTPlug: HTTP client abstraction
2
+ ================================
3
+
4
+ HTTPlug is an abstraction for HTTP clients. There are two main use cases:
5
+
6
+ 1. Usage in a project/application
7
+ 2. Usage in a reusable package
8
+
9
+ The client interfaces
10
+ ---------------------
11
+
12
+ HTTPlug defines two HTTP client interfaces that we kept as simple as possible:
13
+
14
+ * ``HttpClient `` defines a ``sendRequest `` method that sends a PSR-7
15
+ ``RequestInterface `` and either returns a PSR-7 ``ResponseInterface `` or
16
+ throws an exception that implements ``Http\Client\Exception ``.
17
+
18
+ * ``HttpAsyncClient `` defines a ``sendAsyncRequest `` method that sends a request
19
+ asynchronously and always returns a ``Http\Client\Promise ``.
20
+
21
+ Implementations
22
+ ---------------
23
+
24
+ PHP-HTTP offers two types of clients that implement the above interfaces:
25
+
26
+ 1. standalone clients that directly implement the interfaces.
27
+ - Examples: :doc: `/clients/curl-client ` and :doc: `/clients/socket-client `.
28
+
29
+ 2. adapters act as a bridge between the HTTPlug interfaces and HTTP client
30
+ libraries that do not (yet) implement these interfaces. Examples:
31
+ a :doc: `/clients/guzzle6-adapter ` and a :doc: `/clients/react-adapter `.
3
32
4
33
HTTPlug implementations
5
34
-----------------------
Original file line number Diff line number Diff line change @@ -64,17 +64,17 @@ for discussion around a future HTTP client PSR.
64
64
65
65
.. toctree ::
66
66
:hidden:
67
- :maxdepth: 3
68
67
69
68
PHP-HTTP <self >
70
69
71
70
.. toctree ::
72
71
:hidden:
72
+ :caption: HTTPlug
73
73
74
- HTTPlug <httplug >
75
-
76
- .. toctree ::
77
- :hidden:
74
+ Introduction <httplug/introduction >
75
+ Tutorial < httplug/tutorial >
76
+ Migrating < httplug/migrating >
77
+ Virtual package < httplug/virtual-package >
78
78
79
79
clients
80
80
plugins/index
You can’t perform that action at this time.
0 commit comments