Clients & Adapters

There are two types of libraries you can use to send HTTP messages; clients and adapters. A client implements the HttpClient and/or the HttpAsyncClient interfaces directly. A client adapter is a class implementing the interface and forwarding the calls to an HTTP client not implementing the interface. (See Adapter pattern on Wikipedia).

Note

All clients and adapters comply with Liskov substitution principle which means that you can easily change one for another without any side effects.

Name

Type

Links

Stats

php-http/curl-client

Client

Docs, Repo

Latest Version Total Downloads

php-http/socket-client

Client

Docs, Repo

Latest Version Total Downloads

php-http/mock-client

Client

Docs, Repo

Latest Version Total Downloads

symfony/http-client

Client

Docs, Repo

Latest Version Total Downloads

php-http/artax-adapter

Adapter

Docs, Repo

Latest Version Total Downloads

php-http/buzz-adapter

Adapter

Docs, Repo

Latest Version Total Downloads

php-http/cakephp-adapter

Adapter

Docs, Repo

Latest Version Total Downloads

php-http/guzzle5-adapter

Adapter

Docs, Repo

Latest Version Total Downloads

php-http/guzzle6-adapter

Adapter

Docs, Repo

Latest Version Total Downloads

php-http/guzzle7-adapter

Adapter

Docs, Repo

Latest Version Total Downloads

php-http/react-adapter

Adapter

Docs, Repo

Latest Version Total Downloads

php-http/zend-adapter

Adapter

Docs, Repo

Latest Version Total Downloads

Composer Virtual Packages

Virtual packages are a way to specify the dependency on an implementation of an interface-only repository without forcing a specific implementation. For HTTPlug, the virtual packages are called php-http/client-implementation (though you should be using psr/http-client-implementation to use PSR-18) and php-http/async-client-implementation.

There is no library registered with those names. However, all client implementations (including client adapters) for HTTPlug use the provide section to tell composer that they do provide the client-implementation.