PHPackages                             psx/http - 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. psx/http

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

psx/http
========

Mutable HTTP model and HTTP client implementation

v4.2.4(3mo ago)3240.8k—0%18Apache-2.0PHPPHP &gt;=8.0CI passing

Since Apr 2Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/apioo/psx-http)[ Packagist](https://packagist.org/packages/psx/http)[ Docs](https://phpsx.org)[ Fund](https://www.paypal.me/fusioapi)[ GitHub Sponsors](https://github.com/chriskapp)[ RSS](/packages/psx-http/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (7)Versions (37)Used By (8)

HTTP
====

[](#http)

This library contains elegant interfaces to describe HTTP message, middleware and client classes. It contains also corresponding reference implementations which can be used by every app which needs a solid HTTP stack.

Interfaces
----------

[](#interfaces)

### HTTP

[](#http-1)

- [RequestInterface](https://github.com/apioo/psx-http/blob/master/src/RequestInterface.php)
- [ResponseInterface](https://github.com/apioo/psx-http/blob/master/src/ResponseInterface.php)
- [MessageInterface](https://github.com/apioo/psx-http/blob/master/src/MessageInterface.php)

### HTTP Body

[](#http-body)

- [StreamInterface](https://github.com/apioo/psx-http/blob/master/src/StreamInterface.php)

### HTTP Middleware

[](#http-middleware)

- [FilterInterface](https://github.com/apioo/psx-http/blob/master/src/FilterInterface.php)
- [FilterChainInterface](https://github.com/apioo/psx-http/blob/master/src/FilterChainInterface.php)

### HTTP Client

[](#http-client)

- [ClientInterface](https://github.com/apioo/psx-http/blob/master/src/Client/ClientInterface.php)
- [OptionsInterface](https://github.com/apioo/psx-http/blob/master/src/Client/OptionsInterface.php)

Examples
--------

[](#examples)

### Middleware

[](#middleware)

The following shows a simple middleware which always returns the response body `Hello World!`:

```
