PHPackages                             wyrihaximus/react-http-middleware-custom-request-body-parsers - 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. wyrihaximus/react-http-middleware-custom-request-body-parsers

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

wyrihaximus/react-http-middleware-custom-request-body-parsers
=============================================================

react/http middleware for custom request body parsers

2.2.1(3y ago)46.2k2[3 PRs](https://github.com/WyriHaximus/reactphp-http-middleware-custom-request-body-parsers/pulls)MITPHPPHP ^8 || ^7.4

Since Dec 13Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/WyriHaximus/reactphp-http-middleware-custom-request-body-parsers)[ Packagist](https://packagist.org/packages/wyrihaximus/react-http-middleware-custom-request-body-parsers)[ GitHub Sponsors](https://github.com/WyriHaximus)[ RSS](/packages/wyrihaximus-react-http-middleware-custom-request-body-parsers/feed)WikiDiscussions master Synced 5d ago

READMEChangelog (6)Dependencies (7)Versions (10)Used By (0)

Custom request body parsers middleware
======================================

[](#custom-request-body-parsers-middleware)

[![Build Status](https://camo.githubusercontent.com/190334e3696657c34e57d0c1d6891e476a3f88a16661d547dfae40ccd30ec7dd/68747470733a2f2f7472617669732d63692e6f72672f57797269486178696d75732f72656163747068702d687474702d6d6964646c65776172652d637573746f6d2d726571756573742d626f64792d706172736572732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/WyriHaximus/reactphp-http-middleware-custom-request-body-parsers)[![Latest Stable Version](https://camo.githubusercontent.com/9358d1acde816ae0a5a2bbb1820e9a7098d8c763cce36f9e995d30e7e6a3d260/68747470733a2f2f706f7365722e707567782e6f72672f57797269486178696d75732f72656163742d687474702d6d6964646c65776172652d637573746f6d2d726571756573742d626f64792d706172736572732f762f737461626c652e706e67)](https://packagist.org/packages/WyriHaximus/react-http-middleware-custom-request-body-parsers)[![Total Downloads](https://camo.githubusercontent.com/f5d7389cc3b2badecfb187a01d853d191c668d92142aed7fef01cbe46cb66326/68747470733a2f2f706f7365722e707567782e6f72672f57797269486178696d75732f72656163742d687474702d6d6964646c65776172652d637573746f6d2d726571756573742d626f64792d706172736572732f646f776e6c6f6164732e706e67)](https://packagist.org/packages/WyriHaximus/react-http-middleware-custom-request-body-parsers)[![Code Coverage](https://camo.githubusercontent.com/0900d92785c6ced684fe02a9c93859c21869ff9d60f45000dd3b7c63e320d2b5/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f57797269486178696d75732f72656163747068702d687474702d6d6964646c65776172652d637573746f6d2d726571756573742d626f64792d706172736572732f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/WyriHaximus/reactphp-http-middleware-custom-request-body-parsers/?branch=master)[![License](https://camo.githubusercontent.com/0a641812ea2deb06f0471fd399e716d51822d1a503db86f5db33eb22af4f1fa5/68747470733a2f2f706f7365722e707567782e6f72672f57797269486178696d75732f72656163742d687474702d6d6964646c65776172652d637573746f6d2d726571756573742d626f64792d706172736572732f6c6963656e73652e706e67)](https://packagist.org/packages/WyriHaximus/react-http-middleware-custom-request-body-parsers)[![PHP 7 ready](https://camo.githubusercontent.com/62d4f1a002bae5286028aaf42470b4e7ff4945b30d27fe5cb1f0ad83ae92e0fc/687474703a2f2f7068703772656164792e74696d6573706c696e7465722e63682f57797269486178696d75732f72656163747068702d687474702d6d6964646c65776172652d637573746f6d2d726571756573742d626f64792d706172736572732f62616467652e737667)](https://travis-ci.org/WyriHaximus/reactphp-http-middleware-custom-request-body-parsers)

Install
=======

[](#install)

To install via [Composer](http://getcomposer.org/), use the command below, it will automatically detect the latest version and bind it with `^`.

```
composer require wyrihaximus/react-http-middleware-custom-request-body-parsers

```

This middleware parser allows you to define custom parsers for content types. For example the following example adds a parser for the type `str/rot13`. So when a request comes in with the `Content-Type` header `str/rot13` the passed parser will be executed:

Usage
=====

[](#usage)

```
$parsersMiddleware = new CustomRequestBodyParsers();
$parsersMiddleware->addType('str/rot13', function (ServerRequestInterface $request) {
    $body = (string)$request->getBody());
    return $request->withParsedBody(str_rot13($body));
});
$server = new Server([
    $parsersMiddleware,
    /** Other middleware */
]);
```

License
=======

[](#license)

The MIT License (MIT)

Copyright (c) 2017 Cees-Jan Kiewiet

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance56

Moderate activity, may be stable

Popularity23

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 54.5% 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 ~371 days

Total

6

Last Release

1216d ago

Major Versions

1.1.0 → 2.0.02021-04-20

PHP version history (4 changes)1.0.0PHP ^7.0

1.1.0PHP ^7.2

2.0.0PHP ^7.4

2.1.0PHP ^8 || ^7.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/147145?v=4)[Cees-Jan Kiewiet](/maintainers/WyriHaximus)[@WyriHaximus](https://github.com/WyriHaximus)

---

Top Contributors

[![WyriHaximus](https://avatars.githubusercontent.com/u/147145?v=4)](https://github.com/WyriHaximus "WyriHaximus (42 commits)")[![dependabot-support](https://avatars.githubusercontent.com/u/112581971?v=4)](https://github.com/dependabot-support "dependabot-support (16 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (13 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (4 commits)")[![mookman288](https://avatars.githubusercontent.com/u/2126330?v=4)](https://github.com/mookman288 "mookman288 (2 commits)")

---

Tags

hacktoberfestphpreactphp

### Embed Badge

![Health badge](/badges/wyrihaximus-react-http-middleware-custom-request-body-parsers/health.svg)

```
[![Health](https://phpackages.com/badges/wyrihaximus-react-http-middleware-custom-request-body-parsers/health.svg)](https://phpackages.com/packages/wyrihaximus-react-http-middleware-custom-request-body-parsers)
```

###  Alternatives

[league/uri-interfaces

Common tools for parsing and resolving RFC3987/RFC3986 URI

538204.9M23](/packages/league-uri-interfaces)[laudis/neo4j-php-client

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

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

Handles HTTP requests to Discord servers

25318.7k8](/packages/discord-php-http)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28137.8k](/packages/phpro-http-tools)[christoph-kluge/reactphp-http-cors-middleware

A cors middleware for the ReactPHP HTTP-Server

1010.6k3](/packages/christoph-kluge-reactphp-http-cors-middleware)

PHPackages © 2026

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