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(9mo ago)001MITPHPPHP &gt;=8.0.0

Since Sep 25Pushed 9mo 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 today

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

29

—

LowBetter than 57% of packages

Maintenance58

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity43

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

270d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1395583?v=4)[Daniel Bergløv](/maintainers/dbergloev)[@dbergloev](https://github.com/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

[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

25126.1M82](/packages/php-http-cache-plugin)[illuminate/http

The Illuminate Http package.

11937.9M6.9k](/packages/illuminate-http)[rdkafka/rdkafka

A PHP extension for Kafka

2.2k24.3k1](/packages/rdkafka-rdkafka)[httpsoft/http-message

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

87965.9k114](/packages/httpsoft-http-message)[mezzio/mezzio-router

Router subcomponent for Mezzio

265.4M91](/packages/mezzio-mezzio-router)[serpapi/google-search-results-php

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

69127.2k](/packages/serpapi-google-search-results-php)

PHPackages © 2026

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