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).
All clients and adapters comply with Liskov substitution principle which means that you can easily change one for another without any side effects.
.. toctree:: :hidden: clients/curl-client clients/socket-client clients/mock-client clients/artax-adapter clients/buzz-adapter clients/cakephp-adapter clients/guzzle5-adapter clients/guzzle6-adapter clients/react-adapter clients/zend-adapter
||Client||:doc:`Docs </clients/curl-client>`, Repo|
||Client||:doc:`Docs </clients/socket-client>`, Repo|
||Client||:doc:`Docs </clients/mock-client>`, Repo|
||Adapter||:doc:`Docs </clients/artax-adapter>`, Repo|
||Adapter||:doc:`Docs </clients/buzz-adapter>`, Repo|
||Adapter||:doc:`Docs </clients/cakephp-adapter>`, Repo|
||Adapter||:doc:`Docs </clients/guzzle5-adapter>`, Repo|
||Adapter||:doc:`Docs </clients/guzzle6-adapter>`, Repo|
||Adapter||:doc:`Docs </clients/react-adapter>`, Repo|
||Adapter||:doc:`Docs </clients/zend-adapter>`, Repo|
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 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.