Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/httpsoft/http-message
Strict and fast implementation of PSR-7 and PSR-17
https://github.com/httpsoft/http-message
http http-message php psr-17 psr-7 request-response
Last synced: 3 months ago
JSON representation
Strict and fast implementation of PSR-7 and PSR-17
- Host: GitHub
- URL: https://github.com/httpsoft/http-message
- Owner: httpsoft
- License: mit
- Created: 2020-08-22T14:33:48.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2023-11-16T11:06:44.000Z (12 months ago)
- Last Synced: 2024-05-14T00:49:47.251Z (6 months ago)
- Topics: http, http-message, php, psr-17, psr-7, request-response
- Language: PHP
- Homepage: https://httpsoft.org/docs/message
- Size: 146 KB
- Stars: 73
- Watchers: 4
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Security: .github/SECURITY.md
Awesome Lists containing this project
- awesome-psr15-middlewares - httpsoft/http-message
README
# HTTP Message
[![License](https://poser.pugx.org/httpsoft/http-message/license)](https://packagist.org/packages/httpsoft/http-message)
[![Latest Stable Version](https://poser.pugx.org/httpsoft/http-message/v)](https://packagist.org/packages/httpsoft/http-message)
[![Total Downloads](https://poser.pugx.org/httpsoft/http-message/downloads)](https://packagist.org/packages/httpsoft/http-message)
[![GitHub Build Status](https://github.com/httpsoft/http-message/workflows/build/badge.svg)](https://github.com/httpsoft/http-message/actions)
[![GitHub Static Analysis Status](https://github.com/httpsoft/http-message/workflows/static/badge.svg)](https://github.com/httpsoft/http-message/actions)
[![Scrutinizer Code Coverage](https://scrutinizer-ci.com/g/httpsoft/http-message/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/httpsoft/http-message/?branch=master)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/httpsoft/http-message/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/httpsoft/http-message/?branch=master)This package is a lightweight, fast, high-performance and strict implementation of the [PSR-7 HTTP Message](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-7-http-message.md) and [PSR-17 HTTP Factories](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-17-http-factory.md).
The package does not contain any additional functionality other than that defined in the PSR interfaces.
## Documentation
* [In English language](https://httpsoft.org/docs/message).
* [In Russian language](https://httpsoft.org/ru/docs/message).## Installation
This package requires PHP version 7.4 or later.
```
composer require httpsoft/http-message
```## Benchmark
| Runs: 30,000 | Guzzle | HttpSoft | Laminas | Nyholm | Slim |
|----------------------|-----------|-----------|-----------|-----------|-----------|
| Runs per second | 15868 | 19544 | 12257 | 19022 | 12117 |
| Average time per run | 0.0630 ms | 0.0512 ms | 0.0816 ms | 0.0526 ms | 0.0825 ms |
| Total time | 1.8905 s | 1.5349 s | 2.4474 s | 1.5771 s | 2.4757 s |See benchmark at [https://github.com/devanych/psr-http-benchmark](https://github.com/devanych/psr-http-benchmark).
## Usage
> For a description of how to use the package components, see the [PSR-7](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-7-http-message.md) and [PSR-17](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-17-http-factory.md) specifications and [package documentation](https://httpsoft.org/docs/message).
For the convenience of creating requests to the server from PHP superglobals, you can use the [httpsoft/http-server-request](https://github.com/httpsoft/http-server-request) package.
```
composer require httpsoft/http-server-request
```You can use the [httpsoft/http-runner](https://github.com/httpsoft/http-runner) package to run requests to the server and emit responses, as well as build the [PSR-15](https://github.com/php-fig/http-server-middleware) middleware pipelines.
```
composer require httpsoft/http-runner
```