Skip to content

Latest commit

 

History

History
35 lines (21 loc) · 808 Bytes

artax-adapter.rst

File metadata and controls

35 lines (21 loc) · 808 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 relying on discovery </discovery>:

use Http\Adapter\Artax\Client as ArtaxAdapter;

$adapter = new ArtaxAdapter();