Skip to content
Permalink
master
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time

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.