8000 Spice up intro · php-http/documentation@cf1a330 · GitHub
[go: up one dir, main page]

Skip to content

Commit cf1a330

Browse files
committed
Spice up intro
1 parent 67788fb commit cf1a330

File tree

1 file changed

+29
-18
lines changed

1 file changed

+29
-18
lines changed

docs/index.md

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,50 @@
1-
# PHP-HTTP and HTTPlug
1+
# PHP-HTTP: standardized HTTP interaction for PHP
22

3-
**This is the documentation for the HTTPlug client abstraction and the other PHP-HTTP components.**
3+
PHP-HTTP is the next step in standardizing HTTP interaction for PHP packages.
4+
It builds on top of [PSR-7](http://www.php-fig.org/psr/psr-7/), which defines
5+
interfaces for HTTP requests and responses. PSR-7 does not describe, however,
6+
the way you should create requests or send them. PHP-HTTP aims to fill that gap
7+
by offering an HTTP client interface: HTTPlug.
48

9+
PHP-HTTP has three goals:
510

6-
In the past few years HTTP related actions got much more attention. We took a long way from `file_get_contents` to
7-
[PSR-7](http://www.php-fig.org/psr/psr-7/). We still felt that something was missing: and PHP HTTP was born.
11+
1. Encourage package developers to depend on the simple HTTPlug interface
12+
instead of concrete HTTP clients.
813

9-
We aim to provide good quality, HTTP related packages to the PHP community. Our main product is
10-
[HTTPlug](http://httplug.io), but we also have other smaller packages to make using HTTP more convenient.
14+
2. Provide good quality HTTP-related packages to the PHP community.
1115

16+
3. Over time, make HTTPlug a PSR so that clients will directly implement the
17+
HTTPlug interface and our adapters are no longer needed.
1218

1319
## HTTPlug
1420

15-
[PSR-7](http://www.php-fig.org/psr/psr-7/) defines interfaces for HTTP requests and responses.
16-
However, it does not define how to create a request or how to send a request.
1721
HTTPlug abstracts from HTTP clients written in PHP, offering a simple interface.
18-
It also provides an implementation-independent plugin system to build pipelines regardless of the
19-
HTTP client implementation used.
22+
It also provides an implementation-independent plugin system to build pipelines
23+
regardless of the HTTP client implementation used.
2024

2125
HTTPlug allows you to write reusable libraries and applications that need
2226
an HTTP client without binding to a specific implementation.
2327
When all packages used in an application only specify HTTPlug,
24-
the application developers can chose the client that fits best for their
25-
project and use the same client with all packages.
28+
the application developers can choose the client that best fits their project
29+
and use the same client with all packages.
2630

2731
There are clients implementing one of the HTTPlug interfaces directly,
28-
and adapter packages that implement the interface and forward the calls to HTTP clients not implementing the interface.
32+
and adapter packages that implement the interface and forward the calls to HTTP
33+
clients not implementing the interface.
2934

35+
Get started by reading our [tutorial](httplug/tutorial.md).
3036

31-
Read our [tutorial](httplug/tutorial.md).
37+
## Packages
3238

39+
PHP-HTTP offers several packages:
3340

34-
# PHP-HTTP Components
41+
| Type | Description | Namespace |
42+
| --------------- | ----------------------------------------------------------- | -------------------- |
43+
| Clients | HTTP clients: Socket, cURL and others | `Http\Client\[Name]` |
44+
| Client adapters | Adapters for other clients: Guzzle, React and others | `Http\Adapter\[Name]`|
45+
| Plugins | Implementation-independent authentication, cookies and more | `Http\Plugin\[Name]` |
3546

36-
As explained above, PHP HTTP has room for anything that is connected to HTTP and PHP.
37-
Although [HTTPlug](http://httplug.io) is considered to be our "main product", we have other components as well.
47+
## The future
3848

39-
See the list of components in the left side navigation.
49+
HTTPlug, a working example of an HTTP client interface, can serve as a basis
50+
for discussion around a future HTTP client PSR.

0 commit comments

Comments
 (0)
0