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

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

codesaur/http-message
=====================

Цэвэр, минимал, объект хандалтат бүтэцтэй HTTP Message компонент (PSR-7)

v3.0.2(2mo ago)2703↓50%1MITPHPPHP ^8.2.1CI passing

Since Mar 2Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/codesaur-php/HTTP-Message)[ Packagist](https://packagist.org/packages/codesaur/http-message)[ Docs](https://github.com/codesaur-php)[ RSS](/packages/codesaur-http-message/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (6)Versions (44)Used By (1)

codesaur/http-message
=====================

[](#codesaurhttp-message)

[![CI](https://github.com/codesaur-php/HTTP-Message/actions/workflows/ci.yml/badge.svg)](https://github.com/codesaur-php/HTTP-Message/actions/workflows/ci.yml)[![PHP Version](https://camo.githubusercontent.com/1015683ef28e870620edc19b6e22b456c0dc170c260fa4645905e93438f607a6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e322e312d3737374242342e7376673f6c6f676f3d706870)](https://www.php.net/)[![License](https://camo.githubusercontent.com/784362b26e4b3546254f1893e778ba64616e362bd6ac791991d2c9e880a3a64e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e2e737667)](https://camo.githubusercontent.com/784362b26e4b3546254f1893e778ba64616e362bd6ac791991d2c9e880a3a64e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e2e737667)

Агуулга / Table of Contents
---------------------------

[](#агуулга--table-of-contents)

1. [Монгол](#1-%D0%BC%D0%BE%D0%BD%D0%B3%D0%BE%D0%BB-%D1%82%D0%B0%D0%B9%D0%BB%D0%B1%D0%B0%D1%80) | 2. [English](#2-english-description) | 3. [Getting Started](#3-getting-started)

---

1. Монгол тайлбар
-----------------

[](#1-монгол-тайлбар)

Цэвэр, минимал, объект хандалтат бүтэцтэй HTTP Message компонент (PSR-7).

`codesaur/http-message` нь **codesaur ecosystem**-ийн нэг хэсэг бөгөөд PHP-ийн PSR-7 стандартын дагуу **Request**, **Response**, **ServerRequest**, **URI**, **Stream**, **UploadedFile**, **OutputBuffer** зэрэг HTTP мессежийн бүрэлдэхүүнүүдийг хэрэгжүүлсэн бага жинтэй компонент юм.

Багц нь дараах үндсэн классуудаас бүрдэнэ:

- **Message** - PSR-7 MessageInterface хэрэгжилт (headers, protocol, body)
- **Request** - PSR-7 RequestInterface
- **Response** - PSR-7 ResponseInterface
- **ServerRequest** - Глобал орчноос request сэргээдэг advanced implementation
- **Uri** - PSR-7 UriInterface
- **Stream** - PSR-7 StreamInterface хэрэгжилт
- **UploadedFile** - Upload хийгдсэн файлын metadata + moveTo()
- **Output** - StreamInterface хэрэгжилт (output buffering)

### Дэлгэрэнгүй мэдээлэл

[](#дэлгэрэнгүй-мэдээлэл)

- [Бүрэн танилцуулга](docs/mn/README.md) - Суурилуулалт, хэрэглээ, жишээнүүд
- [API тайлбар](docs/mn/api.md) - Бүх метод, exception-үүдийн тайлбар
- [Шалгалтын тайлан](docs/mn/review.md) - Код шалгалтын тайлан

---

2. English description
----------------------

[](#2-english-description)

Clean, minimal, object-oriented HTTP Message component (PSR-7). A lightweight component that implements HTTP message components following PHP's PSR-7 standard, including **Request**, **Response**, **ServerRequest**, **URI**, **Stream**, **UploadedFile**, **OutputBuffer**, and more.

`codesaur/http-message` is part of the **codesaur ecosystem** and is a lightweight PHP component that can be used standalone, independent of any framework.

The package consists of the following core classes:

- **Message** - PSR-7 MessageInterface implementation (headers, protocol, body)
- **Request** - PSR-7 RequestInterface
- **Response** - PSR-7 ResponseInterface
- **ServerRequest** - Advanced implementation that reconstructs request from global environment
- **Uri** - PSR-7 UriInterface
- **Stream** - PSR-7 StreamInterface implementation
- **UploadedFile** - Uploaded file metadata + moveTo()
- **Output** - StreamInterface implementation (output buffering)

### Documentation

[](#documentation)

- [Full Documentation](docs/en/README.md) - Installation, usage, examples
- [API Reference](docs/en/api.md) - Complete API documentation
- [Review](docs/en/review.md) - Code review report

---

3. Getting Started
------------------

[](#3-getting-started)

### Requirements

[](#requirements)

- PHP **8.2.1+**
- **ext-json** PHP extension
- Composer

### Installation

[](#installation)

Composer ашиглан суулгана / Install via Composer:

```
composer require codesaur/http-message
```

### Quick Example

[](#quick-example)

```
use codesaur\Http\Message\ServerRequest;
use codesaur\Http\Message\Response;

// ServerRequest үүсгэх / Create ServerRequest
$request = (new ServerRequest())->initFromGlobal();

// Query params
var_dump($request->getQueryParams());

// PSR-7 headers унших / Read PSR-7 headers
$contentType = $request->getHeaderLine('Content-Type');
$csrfToken = $request->getHeaderLine('X-CSRF-TOKEN');

// Response үүсгэх / Create Response
$response = (new Response())
    ->withStatus(200)
    ->withHeader('Content-Type', 'application/json');

// Body-д бичих / Write to body
$response->getBody()->write(json_encode(['message' => 'Hello, World!']));
```

### Running Tests

[](#running-tests)

Тест ажиллуулах / Run tests:

```
# Бүх тестүүдийг ажиллуулах / Run all tests
composer test

# Coverage-тэй тест ажиллуулах / Run tests with coverage
composer test-coverage
```

---

Changelog
---------

[](#changelog)

- [CHANGELOG.md](CHANGELOG.md) - Full version history

Contributing &amp; Security
---------------------------

[](#contributing--security)

- [Contributing Guide](.github/CONTRIBUTING.md)
- [Security Policy](.github/SECURITY.md)

License
-------

[](#license)

This project is licensed under the MIT License.

Author
------

[](#author)

**Narankhuu**

**codesaur ecosystem:**

###  Health Score

54

—

FairBetter than 97% of packages

Maintenance88

Actively maintained with recent releases

Popularity22

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity78

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

Recently: every ~23 days

Total

43

Last Release

61d ago

Major Versions

v1.9.0 → v2.0.02025-12-17

v2.0.0 → v3.0.02026-01-08

PHP version history (3 changes)v1.0PHP &gt;=7.2.0

v1.5.0PHP &gt;=8.2.1

v3.0.0PHP ^8.2.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/2281c1b7b23007da57ad0526923a5f822dea64629ab1cb70749188d2b869e55c?d=identicon)[codesaur](/maintainers/codesaur)

---

Top Contributors

[![codesaur](https://avatars.githubusercontent.com/u/4127594?v=4)](https://github.com/codesaur "codesaur (68 commits)")

---

Tags

httppsr-7http-messagemessagecodesaurmongolmongolianarankhuucodenкодзаврнаранхүүкоден

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[guzzlehttp/psr7

PSR-7 message implementation that also provides common utility methods

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

PSR-17: Common interfaces for PSR-7 HTTP message factories

1.9k692.9M1.9k](/packages/psr-http-factory)[symfony/psr-http-message-bridge

PSR HTTP message bridge

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

HTTP Message related tools

1.3k263.9M678](/packages/php-http-message)[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)
