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

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

kaspi/http-message
==================

HTTP Message implementation PSR-7, PSR-17

1.3.1(2mo ago)2100↓75%1MITPHPPHP 8.1 - 8.5

Since Jan 23Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/agdobrynin/http-message)[ Packagist](https://packagist.org/packages/kaspi/http-message)[ RSS](/packages/kaspi-http-message/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (10)Dependencies (12)Versions (14)Used By (1)

🕸 HTTP message PSR-7 implementation.
====================================

[](#-http-message-psr-7-implementation)

Kaspi/http-message is a lightweight implementation [PSR-7](https://www.php-fig.org/psr/psr-7), [PSR-17](https://www.php-fig.org/psr/psr-17) for &gt;= PHP 8.1

Implementation of PSR-17:

- `\Kaspi\HttpMessage\HttpFactory::class`

Implementation of PSR-7:

- `\Kaspi\HttpMessage\Message::class`
- `\Kaspi\HttpMessage\Request::class`
- `\Kaspi\HttpMessage\Response::class`
- `\Kaspi\HttpMessage\ServerRequest::class`
- `\Kaspi\HttpMessage\Stream::class`
- `\Kaspi\HttpMessage\UploadedFile::class`
- `\Kaspi\HttpMessage\Uri::class`

Additional implementations for `\Psr\Http\Message\StreamInterface`

- `\Kaspi\HttpMessage\Stream\FileStream::class`
- `\Kaspi\HttpMessage\Stream\PhpMemoryStream::class`
- `\Kaspi\HttpMessage\Stream\PhpTempStream::class`

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

[](#installation)

```
composer require kaspi/http-message
```

- [Local development](#local-development) (without Docker)
- [With Docker images](#using-docker-image-with-php-81-82-83) (WSL, Linux)

Local development
-----------------

[](#local-development)

Required PHP 8.1 or higher, php Composer

### Testing

[](#testing)

Run test without code coverage

```
composer test
```

Running tests with checking code coverage by tests with a report in html format

```
./vendor/bin/phpunit
```

Requires installed [PCOV](https://github.com/krakjoe/pcov) driver

*⛑ the results will be in the folder `.coverage-html`*

### Static code analysis

[](#static-code-analysis)

For static analysis we use the package [Phan](https://github.com/phan/phan).

Running without PHP extension [PHP AST](https://github.com/nikic/php-ast)

```
./vendor/bin/phan --allow-polyfill-parser
```

### Code style

[](#code-style)

To bring the code to standards, we use php-cs-fixer which is declared in composer's dev dependencies

```
composer fixer
```

Using Docker image with PHP 8.1, 8.2, 8.3, 8.4, 8.5
---------------------------------------------------

[](#using-docker-image-with-php-81-82-83-84-85)

You can specify the image with the PHP version in the `.env` file in the `PHP_IMAGE` key. By default, the container is built with the `php:8.1-cli-alpine` image.

Build docker container

```
docker-compose build
```

Install php composer dependencies:

```
docker-compose run --rm php composer install
```

Run tests with a code coverage report and a report in html format

```
docker-compose run --rm php vendor/bin/phpunit --no-coverage
```

⛑ the results will be in the folder `.coverage-html`

Phan (*static analyzer for PHP*)

```
docker-compose run --rm php vendor/bin/phan
```

You can work in a shell in a docker container:

```
docker-compose run --rm php sh
```

##### Using Makefile commands.

[](#using-makefile-commands)

Check and correct code style:

```
make fix
```

Run the static code analyzer:

```
make stat
```

Run tests:

```
make test
```

Run all stages of checks:

```
make all
```

Run tests for all support PHP versions:

```
make test-supports-php
```

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance85

Actively maintained with recent releases

Popularity14

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity66

Established project with proven stability

 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 ~76 days

Recently: every ~125 days

Total

11

Last Release

80d ago

PHP version history (4 changes)v1.0.0PHP ^8.1 || ^8.2 || ^8.3

v1.2.5PHP ^8.1 || ^8.2 || ^8.3 || ^8.4

v1.3.0PHP ^8.1 || ^8.2 || ^8.3 || ^8.4 || ^8.5

1.3.1PHP 8.1 - 8.5

### Community

Maintainers

![](https://www.gravatar.com/avatar/ae700adf1c969c1b76a10204e7b88afc4a3121e2979bce988b4e9fa5a756a827?d=identicon)[ag.dobrynin](/maintainers/ag.dobrynin)

---

Top Contributors

[![agdobrynin](https://avatars.githubusercontent.com/u/14299950?v=4)](https://github.com/agdobrynin "agdobrynin (86 commits)")

---

Tags

http-messagephp-librarypsrpsr-17psr-7http-messagepsr-17

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

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

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

###  Alternatives

[guzzlehttp/psr7

PSR-7 message implementation that also provides common utility methods

7.9k1.0B3.2k](/packages/guzzlehttp-psr7)[symfony/psr-http-message-bridge

PSR HTTP message bridge

1.3k296.6M807](/packages/symfony-psr-http-message-bridge)[nyholm/psr7

A fast PHP7 implementation of PSR-7

1.3k235.4M2.4k](/packages/nyholm-psr7)[laminas/laminas-diactoros

PSR HTTP Message implementations

548105.8M965](/packages/laminas-laminas-diactoros)[httpsoft/http-message

Strict and fast implementation of PSR-7 and PSR-17

86874.0k94](/packages/httpsoft-http-message)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28137.8k](/packages/phpro-http-tools)

PHPackages © 2026

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