PHPackages                             amphp/http-client-psr7 - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. amphp/http-client-psr7

ActiveLibrary[HTTP &amp; Networking](/categories/http)

amphp/http-client-psr7
======================

PSR-7 adapter for Amp's HTTP client.

v1.1.1(1y ago)1381.0k↑13.2%3[2 issues](https://github.com/amphp/http-client-psr7/issues)[1 PRs](https://github.com/amphp/http-client-psr7/pulls)6MITPHPPHP &gt;=8.1CI failing

Since Jun 17Pushed 10mo ago6 watchersCompare

[ Source](https://github.com/amphp/http-client-psr7)[ Packagist](https://packagist.org/packages/amphp/http-client-psr7)[ Docs](https://github.com/amphp/http-client-psr7)[ GitHub Sponsors](https://github.com/amphp)[ RSS](/packages/amphp-http-client-psr7/feed)WikiDiscussions 1.x Synced 2d ago

READMEChangelog (3)Dependencies (13)Versions (5)Used By (6)

amphp/http-client-psr7
======================

[](#amphphttp-client-psr7)

AMPHP is a collection of event-driven libraries for PHP designed with fibers and concurrency in mind. This package provides an [PSR-7](https://www.php-fig.org/psr/psr-7/) adapter and [PSR-18](https://www.php-fig.org/psr/psr-18/) client as a plugin for [`amphp/http-client`](https://github.com/amphp/http-client).

[![Latest Release](https://camo.githubusercontent.com/894540e4a6f916d6337e3d4348c9e978b327890f561121e50e97a22bbb2c1e04/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f616d7068702f687474702d636c69656e742d707372372e7376673f7374796c653d666c61742d737175617265)](https://github.com/amphp/http-client-psr7/releases)[![MIT License](https://camo.githubusercontent.com/942e017bf0672002dd32a857c95d66f28c5900ab541838c6c664442516309c8a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c61742d737175617265)](https://github.com/amphp/http-client-psr7/blob/1.x/LICENSE)

Installation
------------

[](#installation)

This package can be installed as a [Composer](https://getcomposer.org/) dependency.

```
composer require amphp/http-client-psr7
```

Requirements
------------

[](#requirements)

- PHP 8.1+

Usage
-----

[](#usage)

Create `Amp\Http\Client\Psr7\PsrAdapter` instance to convert client requests and responses between native Amp and [PSR-7](https://www.php-fig.org/psr/psr-7/) formats. Adapter doesn't depend on any concrete PSR-7 implementation, so it requires [PSR-17](https://www.php-fig.org/psr/psr-17/) factory interfaces to create PSR-7 requests and responses.

Use `Amp\Http\Client\Psr7\PsrHttpClient` as a drop-in implementation of a [PSR-18](https://www.php-fig.org/psr/psr-18/) `ClientInterface`.

```
