PHPackages                             fsilva/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. [PSR &amp; Standards](/categories/psr-standards)
4. /
5. fsilva/http-message

Abandoned → [slick/http](/?search=slick%2Fhttp)Library[PSR &amp; Standards](/categories/psr-standards)

fsilva/http-message
===================

PSR Http Message compliant package

v0.2.0(10y ago)11.6kMITPHPPHP &gt;=5.4.0

Since Feb 28Pushed 10y ago1 watchersCompare

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

READMEChangelog (1)Dependencies (2)Versions (4)Used By (0)

HTTP Message
============

[](#http-message)

[![Latest Version](https://camo.githubusercontent.com/92f392d6e663e63df2bc40686208b45c88f6123295cf93c145014d75ec1c720b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f73696c76616d66696c6970652f687474702d6d6573736167652e7376673f7374796c653d666c61742d737175617265)](https://github.com/silvamfilipe/http-message/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/17f7d0dd00e9a9b9baa7d64509ec27e581374453ad2763c36b00b954d4e0ea6f/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f73696c76616d66696c6970652f687474702d6d6573736167652f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/silvamfilipe/http-message)[![Coverage Status](https://camo.githubusercontent.com/0adefccaf7df11eaaa5c05ef2fb215966a01f8a66ca49e5be2456471ab3e40f8/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f73696c76616d66696c6970652f687474702d6d6573736167652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/silvamfilipe/http-message/code-structure)[![Quality Score](https://camo.githubusercontent.com/06af3bc92837111d0585b6985a807e8bbd063f9f6c21c97601d34a97578e3ca0/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f73696c76616d66696c6970652f687474702d6d6573736167652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/silvamfilipe/http-message)[![Total Downloads](https://camo.githubusercontent.com/004b1c57791bd1f0dbccb8557b8988a2c452478f1f50dd70abd0f2c3cbbf8cfe/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6673696c76612f687474702d6d6573736167652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/fsilva/http-message)

PSR Http Message compliant package. The goal is to have an HTTP message abstraction that can be used to implement a request/response strategy application.

This package is compliant with PSR-2 code standards and PSR-4 autoload standards. It also applies the [semantic version 2.0.0](http://semver.org) specification.

Installing via Composer
-----------------------

[](#installing-via-composer)

The recommended way to install `Fsilva\HttpMessage` package is through [Composer](https://getcomposer.org/).

```
# Install Composer
curl -sS https://getcomposer.org/installer | php
```

You can add `Fsilva\HttpMessage` package as a dependency using the composer.phar CLI:

```
$ composer require fsilva/http-message
```

Alternatively, you can `Fsilva\HttpMessage` package as a dependency in your project’s existing composer.json file:

```
{
    "require": {
        "fsilva/http-message": "*"
    }
}
```

Basic usage
-----------

[](#basic-usage)

### Creating a very basic HTTP message

[](#creating-a-very-basic-http-message)

```
use Fsilva/HttpMessage/Message;
use Fsilva/HttpMessage/Stream/Buffer;

$message = new Message();
$body = new Buffer();
$body->write(json_encode(['some' => 'value']));

$request = $message->withProtocolVersion(Message::HTTP_1_1)
    ->withHeader('X-Requested-With', 'XMLHttpRequest')
    ->withHeader('User-Agent', 'PHP Request call')
    ->withBody($body)
    ->withoutHeader('pragma')
    ->withAddedHeader('X-Forwarded-For', ['client1', 'proxy1', 'proxy2']);

$strMessage = "GET / HTTP/". $request->getProtocolVersion();

foreach($request->getHeaders() as $name => $values) {
    $strMessage .= "\n{$name}: ". implode(', ', $values);
}

// $strMessage is now a very simple HTTP message.
$strMessage .= "\n\n". $request->getBody()->getContents();
```

Testing
-------

[](#testing)

```
$ vendor/bin/phpunit
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](https://github.com/silvamfilipe/http-message/blob/master/CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Filipe Silva](https://github.com/silvamfilipe)
- [All Contributors](https://github.com/silvamfilipe/http-message/contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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

Total

2

Last Release

3841d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/85bd1fa7a4f7351fdd6fd799684e9adf215c57d26512e9b212a8dd89aca8de1f?d=identicon)[fsilva](/maintainers/fsilva)

---

Top Contributors

[![silvamfilipe](https://avatars.githubusercontent.com/u/5720969?v=4)](https://github.com/silvamfilipe "silvamfilipe (18 commits)")[![philsturgeon](https://avatars.githubusercontent.com/u/67381?v=4)](https://github.com/philsturgeon "philsturgeon (5 commits)")[![RobLoach](https://avatars.githubusercontent.com/u/25086?v=4)](https://github.com/RobLoach "RobLoach (4 commits)")[![marcqualie](https://avatars.githubusercontent.com/u/101022?v=4)](https://github.com/marcqualie "marcqualie (4 commits)")[![bcrowe](https://avatars.githubusercontent.com/u/752603?v=4)](https://github.com/bcrowe "bcrowe (2 commits)")[![Swader](https://avatars.githubusercontent.com/u/1430603?v=4)](https://github.com/Swader "Swader (1 commits)")[![Anahkiasen](https://avatars.githubusercontent.com/u/1321596?v=4)](https://github.com/Anahkiasen "Anahkiasen (1 commits)")[![zackkitzmiller](https://avatars.githubusercontent.com/u/111536?v=4)](https://github.com/zackkitzmiller "zackkitzmiller (1 commits)")[![barryvdh](https://avatars.githubusercontent.com/u/973269?v=4)](https://github.com/barryvdh "barryvdh (1 commits)")[![bencorlett](https://avatars.githubusercontent.com/u/181919?v=4)](https://github.com/bencorlett "bencorlett (1 commits)")[![nyamsprod](https://avatars.githubusercontent.com/u/51073?v=4)](https://github.com/nyamsprod "nyamsprod (1 commits)")[![pborreli](https://avatars.githubusercontent.com/u/77759?v=4)](https://github.com/pborreli "pborreli (1 commits)")

---

Tags

psrhttp-messagepsr-http-messagefsilva

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[psr/container

Common Container Interface (PHP FIG PSR-11)

10.0k1.0B3.7k](/packages/psr-container)[psr/clock

Common interface for reading the clock.

642332.9M343](/packages/psr-clock)[art4/requests-psr18-adapter

Use WordPress/Requests as a PSR-18 HTTP client

153.3k](/packages/art4-requests-psr18-adapter)

PHPackages © 2026

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