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

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

gabbro-php/http
===============

Provides an http message library similar to PSR7

1.006682(7mo ago)001MITPHPPHP &gt;=8.0.0

Since Sep 25Pushed 7mo agoCompare

[ Source](https://github.com/gabbro-php/http)[ Packagist](https://packagist.org/packages/gabbro-php/http)[ RSS](/packages/gabbro-php-http/feed)WikiDiscussions gh-main Synced 1mo ago

READMEChangelogDependencies (1)Versions (4)Used By (1)

Gabbro HTTP Library – PSR-7 Inspired, Mutable by Design
=======================================================

[](#gabbro-http-library--psr-7-inspired-mutable-by-design)

This library provides an HTTP foundation inspired by the [PSR-7 HTTP Message Interface](https://www.php-fig.org/psr/psr-7/), but with some important differences in philosophy and implementation.

Similarities to PSR-7
---------------------

[](#similarities-to-psr-7)

- **Request / Response Separation**
    Requests and responses are represented as distinct objects, each with their own header and body handling.
- **Header Handling**
    Headers are case-insensitive, support multiple values, and preserve insertion order.
- **Stream Abstraction**
    Request and response bodies can be represented as streams, allowing efficient handling of large payloads without requiring the entire content in memory.
- **Interface Familiarity**
    The method naming and conceptual model are close to PSR-7.

Key Differences
---------------

[](#key-differences)

- **Mutable Objects**
    Unlike PSR-7, this library does **not enforce immutability**. Instead of cloning and returning new objects on every modification, you can directly update headers, cookies, etc. in place.

    ```
    $response->addHeader("Content-Type", "application/json");
    $response->send();
    ```
- **Cookie Registry**
    A built-in `CookieRegistry` class manages cookies with attribute flags (`Secure`, `HttpOnly`, `SameSite`, etc.), handling both request parsing and response emission.
- **Simplified Interface**
    The API avoids unnecessary boilerplate (e.g. no requirement to return new instances for trivial changes), making it easier to use in everyday web application code.

Why Mutable?
------------

[](#why-mutable)

There simply is no point to the immutability. An object can always include clone or factory design features without the immutability. Also PSR-7's immutability goes only as far as to the body, where copying the entire body content was deemed to produce to much overhead at which point the remaining immutability makes even less sense.

This library is designed for projects where **clarity and efficiency** are preferred. Headers, cookies, and bodies can be updated directly on the same instance, while still keeping an interface that is clean, predictable, and close to PSR-7 in spirit.

Example
-------

[](#example)

```
$request = new ServerRequest();
$registry = new CookieRegistry();
$registry->readFromRequest($request);

if (!$registry->isSet("SomeCookie")) {
    $registry->set("SomeCookie", "Some Value", 3600);
}

$response = $request->getResponse();
$registry->writeToResponse($response);

$response->send();
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance63

Regular maintenance activity

Popularity0

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity42

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

Total

3

Last Release

224d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ecf19012ac8ad546408e9ca1666b479831b495dc947b263987509a75acd7524b?d=identicon)[dbergloev](/maintainers/dbergloev)

---

Top Contributors

[![dbergloev](https://avatars.githubusercontent.com/u/1395583?v=4)](https://github.com/dbergloev "dbergloev (6 commits)")

### Embed Badge

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

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

###  Alternatives

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M319](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[nyholm/psr7

A fast PHP7 implementation of PSR-7

1.3k235.4M2.4k](/packages/nyholm-psr7)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M293](/packages/pusher-pusher-php-server)[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78126.4M414](/packages/react-http)

PHPackages © 2026

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