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

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

bdk/http-message
================

PSR-7 (HttpMessage) &amp; PSR-17 (HttpFactory) Implementations

v3.3.4(10mo ago)03.5k↑16.7%1MITPHPPHP &gt;=8.0CI passing

Since Nov 10Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/bkdotcom/HttpMessage)[ Packagist](https://packagist.org/packages/bdk/http-message)[ Docs](http://github.com/bkdotcom/HttpMessage)[ RSS](/packages/bdk-http-message/feed)WikiDiscussions 2.x Synced 1mo ago

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

HttpMessage
===========

[](#httpmessage)

PSR-7 (HttpMessage) &amp; PSR-17 (HttpFactory) Implementations

Notable features
----------------

[](#notable-features)

- Ability to register per-media-type custom body parsers
- By default the following parsers are registered
    - application/x-www-form-urlencoded - Preserves "." and space in keys
    - application/json - decoded to array
    - application/xml, text/xml parsed to SimpleXMLElement obj
- parsedBody and queryParams preserves "." and spaces in keys
- `UploadedFile::getClientFullPath()`. PHP 8.1 added a new file upload property (not included in PSR-7)
- `ServerRequestExtended` interface and implementation - Extends standard server request with helpful methods

### Utilities

[](#utilities)

- ContentType: common mime-type constants
- HttpFoundationBridge: create ServerRequest and Response from HttpFoundation request and response
- ParseStr: PHP's `parse_str()`, but does not convert dots and spaces to '\_' by default
- Response:
    - `emit(ResponseInterface $response)` - Output response headers and body
    - `codePhrase(int|string $code): string` - Get standard code phrase for given HTTP status code
- ServerRequest:
    - `fromGlobals(): ServerRequestInterface`
- Stream
    - `getContent(StreamInterface): string` - Get stream contents without affecting pointer
- Uri:
    - `fromGlobals(): UriInterface`
    - `fromParsed(array): UriInterface`
    - `isCrossOrigin(UriInterface $uri1, UriInterface $uri2): bool`
    - `parseUrl(string|UriInterface): array` - like php's `parse_url` but with bug fixes backported
    - `resolve(UriInterface $base, UriInterface $rel): UriInterface` - Converts the relative URI into a new URI that is resolved against the base URI.

### Installation

[](#installation)

`composer require bdk/http-message`

### Documentation

[](#documentation)

### 3 maintained versions:

[](#3-maintained-versions)

Versionhttp-messagehttp-factoryphpnote3.x^1.1 | ^2.0^1.0&gt;= 8.0`static` returns2.x^1.1 | ^2.0^1.0&gt;= 7.2`self` returns1.x~1.0.1--&gt;= 5.4 Tests / Quality
---------------

[](#tests--quality)

[![Supported PHP versions](https://camo.githubusercontent.com/37140af4bc1c3c23bb29b3e054a22fffeccbb8a685c47d28672a70d1b957c908/68747470733a2f2f696d672e736869656c64732e696f2f7374617469632f76313f6c6162656c3d504850266d6573736167653d352e342532302d253230382e3526636f6c6f723d626c7565)](https://camo.githubusercontent.com/37140af4bc1c3c23bb29b3e054a22fffeccbb8a685c47d28672a70d1b957c908/68747470733a2f2f696d672e736869656c64732e696f2f7374617469632f76313f6c6162656c3d504850266d6573736167653d352e342532302d253230382e3526636f6c6f723d626c7565)[![Build Status](https://camo.githubusercontent.com/123b621326b65c08ef2aa927de21c1bbf2c3813fd58a79c39251eca7d78320d8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f626b646f74636f6d2f487474704d6573736167652f706870756e69742e796d6c2e7376673f6c6f676f3d676974687562)](https://camo.githubusercontent.com/123b621326b65c08ef2aa927de21c1bbf2c3813fd58a79c39251eca7d78320d8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f626b646f74636f6d2f487474704d6573736167652f706870756e69742e796d6c2e7376673f6c6f676f3d676974687562)

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance70

Regular maintenance activity

Popularity22

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity61

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

Total

22

Last Release

95d ago

Major Versions

v1.3.2 → v3.3.22024-10-11

v2.3.3 → v3.3.32024-10-28

v1.3.3 → v2.3.42025-07-13

v1.3.4 → v3.3.42025-07-13

1.x-dev → 3.x-dev2025-11-30

PHP version history (4 changes)v1.0PHP &gt;=5.4.0

v2.0PHP &gt;=7.2

v1.2PHP &gt;=5.4

v3.0PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/573f67023e7d41ccd0618b6732cc908e1a30f5d0df514b792b0ebc5379f9d659?d=identicon)[brad.kent](/maintainers/brad.kent)

---

Top Contributors

[![bkdotcom](https://avatars.githubusercontent.com/u/2137404?v=4)](https://github.com/bkdotcom "bkdotcom (69 commits)")

---

Tags

psr-7psr-17httpmessageHttpFactory

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[guzzlehttp/psr7

PSR-7 message implementation that also provides common utility methods

8.0k1.0B3.2k](/packages/guzzlehttp-psr7)[nyholm/psr7

A fast PHP7 implementation of PSR-7

1.3k235.4M2.4k](/packages/nyholm-psr7)[laminas/laminas-diactoros

PSR HTTP Message implementations

546105.8M965](/packages/laminas-laminas-diactoros)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28137.8k](/packages/phpro-http-tools)[nyholm/psr7-server

Helper classes to handle PSR-7 server requests

9521.1M307](/packages/nyholm-psr7-server)[laminas/laminas-stratigility

PSR-7 middleware foundation for building and dispatching middleware pipelines

586.6M81](/packages/laminas-laminas-stratigility)

PHPackages © 2026

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