Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
44 lines (25 sloc) 1022 Bytes

Artax Adapter

An HTTPlug adapter for the Artax HTTP client.

Installation

To install the Artax adapter, which will also install Artax itself (if it was not yet included in your project), run:

$ composer require php-http/artax-adapter

Usage

Begin by creating a Artax adapter:

use Amp\Artax\DefaultClient;
use Http\Adapter\Artax\Client as ArtaxAdapter;
use Http\Message\MessageFactory\GuzzleMessageFactory;

$adapter = new ArtaxAdapter(new DefaultClient(), new GuzzleMessageFactory());

Or if you installed the :doc:`discovery </discovery>` layer:

use Http\Adapter\Artax\Client as ArtaxAdapter;

$adapter = new ArtaxAdapter();

Warning

The message factory parameter is mandatory if the discovery layer is not installed.