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(4mo ago)2122↓93.8%1MITPHPPHP 8.1 - 8.5

Since Jan 23Pushed 4mo 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 yesterday

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

45

—

FairBetter than 91% of packages

Maintenance77

Regular maintenance activity

Popularity14

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity67

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

125d 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

8.0k1.1B4.0k](/packages/guzzlehttp-psr7)[symfony/psr-http-message-bridge

PSR HTTP message bridge

1.3k320.9M982](/packages/symfony-psr-http-message-bridge)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[mezzio/mezzio

PSR-15 Middleware Microframework

3923.8M125](/packages/mezzio-mezzio)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28150.5k](/packages/phpro-http-tools)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

85036.3k](/packages/flow-php-flow)

PHPackages © 2026

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