PHPackages                             sekjun9878/request-parser - 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. sekjun9878/request-parser

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

sekjun9878/request-parser
=========================

A library to parse raw HTTP requests for PHP CLI web servers and more.

v1.0.1(11y ago)67.3k[1 issues](https://github.com/sekjun9878/request-parser/issues)MITPHPPHP &gt;=5.4.0

Since Jan 20Pushed 11y ago1 watchersCompare

[ Source](https://github.com/sekjun9878/request-parser)[ Packagist](https://packagist.org/packages/sekjun9878/request-parser)[ Docs](https://github.com/sekjun9878/request-parser)[ RSS](/packages/sekjun9878-request-parser/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

RequestParser [![Build Status](https://camo.githubusercontent.com/673e399a4cbe38379b3d052e2580516360fc5985131c315dc4313d7c33441572/68747470733a2f2f636972636c6563692e636f6d2f67682f73656b6a756e393837382f726571756573742d7061727365722e7376673f636972636c652d746f6b656e3d3a636972636c652d746f6b656e)](https://circleci.com/gh/sekjun9878/request-parser)
========================================================================================================================================================================================================================================================================================================================================================

[](#requestparser-)

[![Latest Stable Version](https://camo.githubusercontent.com/b3c082cd36060f2474d4f8810e948492d2bf37e6e5232a4defa0e975547700d2/68747470733a2f2f706f7365722e707567782e6f72672f73656b6a756e393837382f726571756573742d7061727365722f762f737461626c652e737667)](https://packagist.org/packages/sekjun9878/request-parser) [![Total Downloads](https://camo.githubusercontent.com/d42ab9de0c9cd3cf19ee0f07954f320b93babe4503ff81141655f94f8f7445a5/68747470733a2f2f706f7365722e707567782e6f72672f73656b6a756e393837382f726571756573742d7061727365722f646f776e6c6f6164732e737667)](https://packagist.org/packages/sekjun9878/request-parser) [![Latest Unstable Version](https://camo.githubusercontent.com/805fa558034b56ee9ea773d97d8540f128bea694e2ccf8d423f02412b3c7a4e2/68747470733a2f2f706f7365722e707567782e6f72672f73656b6a756e393837382f726571756573742d7061727365722f762f756e737461626c652e737667)](https://packagist.org/packages/sekjun9878/request-parser) [![License](https://camo.githubusercontent.com/7a0f94b93c166fb639e583aeef33edefc6d7a141117576eb16ed46639f89b6c1/68747470733a2f2f706f7365722e707567782e6f72672f73656b6a756e393837382f726571756573742d7061727365722f6c6963656e73652e737667)](https://packagist.org/packages/sekjun9878/request-parser)

RequestParser is a PHP library for parsing raw HTTP requests.

This library is not a complete to-specification implementation of the HTTP/1.1 protocol (because doing that would be extremely difficult and unnecessary), but implements most of the spec and should be good enough for the purposes of a specific-purpose HTTP server such as an API server for a PHP CLI application.

If in doubt, try it and see if it works for your purpose! But don't come knocking on my door if you accidentally manage to blow up your back yard... somehow.

Features
========

[](#features)

- Easy to use
- Unit tested
- Comes in both Composer and PHAR versions
- Supports Transfer-Encoding: Chunked
- Batteries included!
    - We provide examples for you to copy paste and,
    - We return a default Request object for you to use instantly

Examples
========

[](#examples)

Here is a quick example to demonstrate how easy it is to instantly get started:

```
$requestParser = new RequestParser;
$requestParser->addData("GET /democracy/init HTTP/1.1\r\nUser-Agent: The Illuminati/2.0\r\nContent-Length: 10\r\n\r\nOver 9000!");

$request = Request::create($requestParser->exportRequestState());

var_dump($request->getHeaders());
var_dump($request->getPOST());

```

You can find more examples in the `examples/` folder. The library is simple enough to use straight away without a documentation, but one is coming soon hopefully.

Installation
============

[](#installation)

Composer
--------

[](#composer)

request-parser is PSR-4 compliant and can be installed using Composer. Simply add sekjun9878/request-parser to your composer.json file. *Composer is the sane alternative to PEAR. It is excellent for managing dependencies in larger projects.*

```
{
    "require": {
        "sekjun9878/request-parser": "~1.0"
    }
}

```

or

```
php composer.phar require sekjun9878/request-parser ~1.0

```

PHAR
----

[](#phar)

A [PHP Archive](http://php.net/manual/en/book.phar.php) (or .phar) file is available for [downloading](https://github.com/sekjun9878/request-parser/releases/latest). Simply [download](https://github.com/sekjun9878/request-parser/releases/latest) the .phar, drop it into your project, and include it like you would any other php file. *This method is ideal for smaller projects, one off scripts, and quick API hacking.*

```
require_once(__DIR__."/request-parser.phar");

```

Downloads
=========

[](#downloads)

For installation, see the installation notes above.

Download latest stable request-parser.phar [here](https://github.com/sekjun9878/request-parser/releases/latest). Download latest master request-parser.phar [here](https://www.michael.yoo.id.au/projects/request-parser/api/download-latest-build.php).

Additional links:

API to return the URL to download the latest master build from:

License
=======

[](#license)

```
Copyright (c) 2014 Michael Yoo
Released under the MIT license; see LICENSE
https://github.com/sekjun9878/request-parser

This project contains portions of source code from other projects; see LICENSE.

```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

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

Total

2

Last Release

4134d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/18661e7412abf57790cfa67f56f11a30f52443a73d33559b273a2518cbb9d9e9?d=identicon)[sekjun9878](/maintainers/sekjun9878)

---

Top Contributors

[![msjyoo](https://avatars.githubusercontent.com/u/2097812?v=4)](https://github.com/msjyoo "msjyoo (25 commits)")

---

Tags

httprequestparse

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sekjun9878-request-parser/health.svg)

```
[![Health](https://phpackages.com/badges/sekjun9878-request-parser/health.svg)](https://phpackages.com/packages/sekjun9878-request-parser)
```

###  Alternatives

[guzzlehttp/psr7

PSR-7 message implementation that also provides common utility methods

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

Common interface for HTTP messages

7.1k1.0B5.5k](/packages/psr-http-message)[psr/http-factory

PSR-17: Common interfaces for PSR-7 HTTP message factories

1.9k692.9M1.9k](/packages/psr-http-factory)[fig/http-message-util

Utility classes and constants for use with PSR-7 (psr/http-message)

39489.0M274](/packages/fig-http-message-util)[nette/http

🌐 Nette Http: abstraction for HTTP request, response and session. Provides careful data sanitization and utility for URL and cookies manipulation.

48619.2M541](/packages/nette-http)[psr/http-server-handler

Common interface for HTTP server-side request handler

175101.3M921](/packages/psr-http-server-handler)

PHPackages © 2026

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