Skip to content

Commit 05e37ca

Browse files
kelunikNyholm
authored andcommitted
Add docs for artax-adapter (#206)
* Add docs for artax-adapter * Add Artax to spelling_word_list.txt
1 parent df79a8d commit 05e37ca

File tree

3 files changed

+53
-0
lines changed

3 files changed

+53
-0
lines changed

clients.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ interface and forwarding the calls to an HTTP client not implementing the interf
1616
clients/curl-client
1717
clients/socket-client
1818
clients/mock-client
19+
clients/artax-adapter
1920
clients/buzz-adapter
2021
clients/cakephp-adapter
2122
clients/guzzle5-adapter
@@ -30,6 +31,7 @@ interface and forwarding the calls to an HTTP client not implementing the interf
3031
"``php-http/curl-client``", "Client", ":doc:`Docs </clients/curl-client>`, `Repo <https://github.com/php-http/curl-client>`__", "|curl_version| |curl_downloads| "
3132
"``php-http/socket-client``", "Client", ":doc:`Docs </clients/socket-client>`, `Repo <https://github.com/php-http/socket-client>`__", "|socket_version| |socket_downloads| "
3233
"``php-http/mock-client``", "Client", ":doc:`Docs </clients/mock-client>`, `Repo <https://github.com/php-http/mock-client>`__", "|mock_version| |mock_downloads| "
34+
"``php-http/artax-adapter``", "Adapter", ":doc:`Docs </clients/artax-adapter>`, `Repo <https://github.com/php-http/artax-adapter>`__", "|artax_version| |artax_downloads| "
3335
"``php-http/buzz-adapter``", "Adapter", ":doc:`Docs </clients/buzz-adapter>`, `Repo <https://github.com/php-http/buzz-adapter>`__", "|buzz_version| |buzz_downloads| "
3436
"``php-http/cakephp-adapter``", "Adapter", ":doc:`Docs </clients/cakephp-adapter>`, `Repo <https://github.com/php-http/cakephp-adapter>`__", "|cakephp_version| |cakephp_downloads| "
3537
"``php-http/guzzle5-adapter``", "Adapter", ":doc:`Docs </clients/guzzle5-adapter>`, `Repo <https://github.com/php-http/guzzle5-adapter>`__", "|guzzle5_version| |guzzle5_downloads| "
@@ -74,6 +76,13 @@ HTTPlug use the ``provide`` section to tell composer that they do provide the cl
7476
:target: https://github.com/php-http/mock-client/releases
7577
:alt: Latest Version
7678

79+
.. |artax_downloads| image:: https://img.shields.io/packagist/dt/php-http/artax-adapter.svg?style=flat-square
80+
:target: https://packagist.org/packages/php-http/artax-adapter
81+
:alt: Total Downloads
82+
.. |artax_version| image:: https://img.shields.io/github/release/php-http/artax-adapter.svg?style=flat-square
83+
:target: https://github.com/php-http/artax-adapter/releases
84+
:alt: Latest Version
85+
7786
.. |buzz_downloads| image:: https://img.shields.io/packagist/dt/php-http/buzz-adapter.svg?style=flat-square
7887
:target: https://packagist.org/packages/php-http/buzz-adapter
7988
:alt: Total Downloads

clients/artax-adapter.rst

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
Artax Adapter
2+
=============
3+
4+
An HTTPlug adapter for the `Artax HTTP client`_.
5+
6+
Installation
7+
------------
8+
9+
To install the Artax adapter, which will also install Artax itself (if it was
10+
not yet included in your project), run:
11+
12+
.. code-block:: bash
13+
14+
$ composer require php-http/artax-adapter
15+
16+
.. include:: includes/install-message-factory.inc
17+
18+
.. include:: includes/install-discovery.inc
19+
20+
Usage
21+
-----
22+
23+
Begin by creating a Artax adapter::
24+
25+
use Amp\Artax\DefaultClient;
26+
use Http\Adapter\Artax\Client as ArtaxAdapter;
27+
use Http\Message\MessageFactory\GuzzleMessageFactory;
28+
29+
$adapter = new ArtaxAdapter(new DefaultClient(), new GuzzleMessageFactory());
30+
31+
Or if you installed the :doc:`discovery </discovery>` layer::
32+
33+
use Http\Adapter\Artax\Client as ArtaxAdapter;
34+
35+
$adapter = new ArtaxAdapter();
36+
37+
.. warning::
38+
39+
The message factory parameter is mandatory if the discovery layer is not installed.
40+
41+
.. include:: includes/further-reading-sync.inc
42+
43+
.. _Artax HTTP client: https://github.com/amphp/artax

spelling_word_list.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
Artax
12
async
23
auth
34
backtrace

0 commit comments

Comments
 (0)