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

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

http-php/messages
=================

A simple OOP wrapper to work with HTTP messages in PHP

211PHP

Since Feb 6Pushed 3y ago1 watchersCompare

[ Source](https://github.com/http-php/message)[ Packagist](https://packagist.org/packages/http-php/messages)[ RSS](/packages/http-php-messages/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Message
=======

[](#message)

[![Latest Version](https://camo.githubusercontent.com/4c654a1f287b6db204981aeecbfa9fa5bb68ccd0cab42de409e4bff50ff9cc00/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f687474702d7068702f6d6573736167652e7376673f7374796c653d666c61742d737175617265266c6162656c3d72656c65617365)](https://packagist.org/packages/http-php/message)[![PHP Version](https://camo.githubusercontent.com/d7077958e1c600549e4e36a504cc6ab73645ec7f55f6663eb33291ea97c9fbcb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f687474702d7068702f6d6573736167652e7376673f7374796c653d666c61742d737175617265)](https://php.net)[![Tests](https://github.com/http-php/message/actions/workflows/test.yml/badge.svg)](https://github.com/http-php/message/actions/workflows/test.yml)[![Total Downloads](https://camo.githubusercontent.com/cf95630a05d562f1eb873f2a5a2d2a73b6fbc1a24fdf83bf46a9d4575d4caaa2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f687474702d7068702f6d6573736167652e7376673f7374796c653d666c61742d73717561726526636f6c6f72423d6d656469756d76696f6c6574726564)](https://packagist.org/packages/http-php/message)

This package is to allow you to create HTTP Messages in PHP, in a simple and reliable way.

Installation
------------

[](#installation)

```
composer require http-php/message
```

Usage
-----

[](#usage)

To use this package, it is very simple. Create a message using the following code:

```
use HttpPHP\Message\Message;

$message = Message::make(
    payload: ['test' => 'payload'],
);

// Add a header
$message->withHeader(
    key: 'Authorization',
    value: 'Bearer some-super-secret-token',
);

// Fetch the header value
$message->header(
    key: 'Authorization',
)->toString(); // 'Bearer some-super-secret-token'

// Fetch all headers
$message->headers();

// Fetch the payload
$message->payload()->parse(); // Returns an array representation of the payload.
$message->payload()->body(); // Returns the raw payload you wish to send.
```

Testing
-------

[](#testing)

To run the test suite:

```
composer run test
```

Credits
-------

[](#credits)

- [Steve McDougall](https://github.com/JustSteveKing)
- [All Contributors](../../contributors)

LICENSE
-------

[](#license)

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

###  Health Score

16

—

LowBetter than 4% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity24

Early-stage or recently created project

 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.

### Community

Maintainers

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

---

Top Contributors

[![JustSteveKing](https://avatars.githubusercontent.com/u/6368379?v=4)](https://github.com/JustSteveKing "JustSteveKing (3 commits)")

### Embed Badge

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

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

###  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.8k](/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.4M90](/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)
