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

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

phrity/http
===========

Utilities and interfaces for handling HTTP.

1.1.0(4mo ago)0108.4k↓11.4%1MITPHPPHP ^8.1CI passing

Since Sep 7Pushed 4mo agoCompare

[ Source](https://github.com/sirn-se/phrity-http)[ Packagist](https://packagist.org/packages/phrity/http)[ Docs](https://phrity.sirn.se/http)[ RSS](/packages/phrity-http/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (7)Versions (4)Used By (1)

[![Phrity Http](docs/logotype.png)](docs/logotype.png)

[![Build Status](https://github.com/sirn-se/phrity-http/actions/workflows/acceptance.yml/badge.svg)](https://github.com/sirn-se/phrity-http/actions)

Phrity Http
===========

[](#phrity-http)

Utilities and interfaces for handling HTTP.

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

[](#installation)

Install with [Composer](https://getcomposer.org/);

```
composer require phrity/http

```

HttpFactory
-----------

[](#httpfactory)

Convenience wrapper for HTTP factories, where you can add all or any factories to the same class. The class will then delegate to actual implementation. If any implementation is missing, a BadMethodCallException will be thrown.

Supports RequestFactoryInterface, ResponseFactoryInterface, ServerRequestFactoryInterface, StreamFactoryInterface, UploadedFileFactoryInterface and UriFactoryInterface from [PSR-17](https://www.php-fig.org/psr/psr-17/).

```
$factory = new Phrity\Http\HttpFactory(
    requestFactory: $requestFactoryImplementation,
    responseFactory: $responseFactoryImplementation,
    serverRequestFactory: $serverRequestFactoryImplementation,
    streamFactory: $streamFactoryImplementation,
    uploadedFileFactory: $ruploadedFileFactoryImplementation,
    uriFactory: $uriFactoryImplementation,
);
```

Popular PSR-17 implementations, such as [Nyholm](https://packagist.org/packages/nyholm/psr7) and [Guzzle](https://packagist.org/packages/guzzlehttp/psr7), often offer factories that support all interfaces. By using the `create()` method, the HttpFactory can take any implementation and configure the HttpFactory class with the factories the implementation supports.

```
$guzzlePsr7 = new GuzzleHttp\Psr7\HttpFactory();
$factory = Phrity\Http\HttpFactory::create($guzzlePsr7);
```

Serializer
----------

[](#serializer)

The serializer takes a PSR-7 HTTP Message and converts it to string. This string representation is a "raw" representation of HTTP request or response.

```
$serializer = new Serializer();
$request = $serializer->request($psrRequest);
$response = $serializer->response($psrResponse);
$message = $serializer->message($psrMessage);
```

Versions
--------

[](#versions)

VersionPHP`1.1``^8.1`Serializer; HTTP messages to string representation`1.0``^8.1`HttpFactory convenience wrapper

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance74

Regular maintenance activity

Popularity33

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~53 days

Total

3

Last Release

147d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4255391?v=4)[Sören Jensen](/maintainers/sirn-se)[@sirn-se](https://github.com/sirn-se)

---

Top Contributors

[![sirn-se](https://avatars.githubusercontent.com/u/4255391?v=4)](https://github.com/sirn-se "sirn-se (7 commits)")

---

Tags

httphttp-factoryphp-librarypsr-17httppsr-7psr-17HTTP FactoriesHTTP Serializer

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/phrity-http/health.svg)

```
[![Health](https://phpackages.com/badges/phrity-http/health.svg)](https://phpackages.com/packages/phrity-http)
```

###  Alternatives

[guzzlehttp/psr7

PSR-7 message implementation that also provides common utility methods

8.0k1.0B3.2k](/packages/guzzlehttp-psr7)[laminas/laminas-diactoros

PSR HTTP Message implementations

546105.8M965](/packages/laminas-laminas-diactoros)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28137.8k](/packages/phpro-http-tools)[laminas/laminas-stratigility

PSR-7 middleware foundation for building and dispatching middleware pipelines

586.6M81](/packages/laminas-laminas-stratigility)[middlewares/utils

Common utils for PSR-15 middleware packages

503.4M92](/packages/middlewares-utils)[elastic/transport

HTTP transport PHP library for Elastic products

1920.6M7](/packages/elastic-transport)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
