PHPackages                             kekos/parse-request-body-middleware - 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. kekos/parse-request-body-middleware

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

kekos/parse-request-body-middleware
===================================

PSR-15 middleware for parsing requests with JSON and URI encoded bodies regardless of HTTP method.

v2.1.0(1mo ago)26711MITPHPPHP ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0CI failing

Since Jul 25Pushed 1mo agoCompare

[ Source](https://github.com/Kekos/parse-request-body-middleware)[ Packagist](https://packagist.org/packages/kekos/parse-request-body-middleware)[ RSS](/packages/kekos-parse-request-body-middleware/feed)WikiDiscussions main Synced 3d ago

READMEChangelogDependencies (20)Versions (8)Used By (1)

Request body parser PSR-15 middleware
=====================================

[](#request-body-parser-psr-15-middleware)

PSR-15 middleware for parsing requests with JSON and URI encoded bodies regardless of HTTP method.

Version 2 calls `request_parse_body()` when applicable, which is when a webserver SAPI is used. This excludes running in test runners or CLI. It's also important to *not* consume the `php://input` stream or else an `\Kekos\ParseRequestBodyMiddleware\ParserException` will be thrown.

Install
-------

[](#install)

You can install this package via [Composer](http://getcomposer.org/):

```
composer require kekos/multipart-form-data-parser

```

Documentation
-------------

[](#documentation)

### Supported content types native PHP

[](#supported-content-types-native-php)

MIME typePOSTPUT/PATCHapplication/jsonapplication/x-www-form-urlencoded✓\*multipart/form-data✓\*\* Supported by calling `request_parse_body()` in PHP &gt;= 8.4

### Supported content types this package

[](#supported-content-types-this-package)

This package acts like a polyfill for unsupported content types (JSON) and types only supported in POST methods by PHP.

MIME typePOSTPUT/PATCHapplication/json✓✓application/x-www-form-urlencoded✓multipart/form-data✓Usage
-----

[](#usage)

Add the `\Kekos\ParseRequestBodyMiddleware\ParseRequestBodyMiddleware` middleware to your PSR-15 handler, and it will populate `ServerRequestInterface::getParsedBody()` as array.

The parser will throw `\Kekos\ParseRequestBodyMiddleware\ParserException` if a malformed JSON body was sent.

Bugs and improvements
---------------------

[](#bugs-and-improvements)

Report bugs in GitHub issues or feel free to make a pull request :-)

License
-------

[](#license)

MIT

###  Health Score

53

—

FairBetter than 97% of packages

Maintenance92

Actively maintained with recent releases

Popularity18

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity77

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

Recently: every ~337 days

Total

7

Last Release

39d ago

Major Versions

v1.1.3 → v2.0.02024-12-27

PHP version history (6 changes)v1.0.0PHP ^7.2

v1.1.0PHP ^7.2 || ~8.0.0

v1.1.1PHP ~7.4 || ~8.0 || ~8.1

v1.1.2PHP ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0

v1.1.3PHP ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0

v2.1.0PHP ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0

### Community

Maintainers

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

---

Top Contributors

[![Kekos](https://avatars.githubusercontent.com/u/914782?v=4)](https://github.com/Kekos "Kekos (30 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Type Coverage Yes

### Embed Badge

![Health badge](/badges/kekos-parse-request-body-middleware/health.svg)

```
[![Health](https://phpackages.com/badges/kekos-parse-request-body-middleware/health.svg)](https://phpackages.com/packages/kekos-parse-request-body-middleware)
```

###  Alternatives

[guzzlehttp/psr7

PSR-7 message implementation that also provides common utility methods

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

RoadRunner: HTTP and PSR-7 worker

779.2M48](/packages/spiral-roadrunner-http)[mezzio/mezzio-authentication-oauth2

OAuth2 (server) authentication middleware for Mezzio and PSR-7 applications.

28483.0k2](/packages/mezzio-mezzio-authentication-oauth2)[laudis/neo4j-php-client

Neo4j-PHP-Client is the most advanced PHP Client for Neo4j

184616.9k31](/packages/laudis-neo4j-php-client)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28137.8k](/packages/phpro-http-tools)[openswoole/core

Openswoole core library

181.1M32](/packages/openswoole-core)

PHPackages © 2026

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