PHPackages                             scu2008/httpparsor - 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. scu2008/httpparsor

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

scu2008/httpparsor
==================

A php parser to deal with http request

510PHP

Since Apr 13Pushed 10y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

HttpParser
==========

[](#httpparser)

the httpparser is a php parser to deal with http request data. the purpose is to solve a kind of http content types,such as **application/json application/xml application/x-www-form-urlencoded multipart/form-data** especially multipart/form-data.

we all know that the http request contain DELETE GET HEAD PATCH POST PUT. for many frameworks such as laravel slim use the php://input method to get the http data,while this is not very well to deal with multipart/form-data as not POST method(as PATCH PUT).it most appears in RESTful pattern.

---

httpparser是一个处理http请求数据的php解析器,通过httpparser来解析各种类型的http请求数据 content-type 为**application/json application/xml application/x-www-form-urlencoded multipart/form-data**，特别是在restful模式下面 经常需要处理multipart/form-data，而且请求方式不为POST的情况

特性
--

[](#特性)

- 统一采用php://input方式获取数据
- 针对非POST方式时的multipart/form-data进行分块解析
- 文件或图片完全储存在内存中操作速度非常快

类的基本说明
------

[](#类的基本说明)

- http 全局处理http 请求
- parser 处理各种content-type
- collection a collection class一个集合类
- body an HTTP message body 一个消息体

attentions 注意事项
---------------

[](#attentions-注意事项)

- 当使用非POST方式上传文件时不再使用$\_FILES数组处理
- 当使用非POST方式上传文件时文件内容不是文件名的方式而是采用字符串的方式保存在内存中

examples
--------

[](#examples)

```
$httpparser = new \HttpParser\Http();
$method = $httpparser->getMethod();
if($method == 'GET'){
   $queryParams = $httpparser->getQueryParams();  //get方式的获取数据
}else{
   $parsedBody = $httpparser->getParsedBody();   //非get方式获取数据
}
```

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/59efcf6b380e73239930262444e3a3a1781a0dfd290f85b8b797b0dc118ccd39?d=identicon)[zhufanmao](/maintainers/zhufanmao)

---

Top Contributors

[![hikenote](https://avatars.githubusercontent.com/u/8486259?v=4)](https://github.com/hikenote "hikenote (31 commits)")

### Embed Badge

![Health badge](/badges/scu2008-httpparsor/health.svg)

```
[![Health](https://phpackages.com/badges/scu2008-httpparsor/health.svg)](https://phpackages.com/packages/scu2008-httpparsor)
```

###  Alternatives

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M319](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M293](/packages/pusher-pusher-php-server)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78026.4M414](/packages/react-http)[php-http/curl-client

PSR-18 and HTTPlug Async client with cURL

48347.0M384](/packages/php-http-curl-client)[smi2/phpclickhouse

PHP ClickHouse Client

84310.1M71](/packages/smi2-phpclickhouse)

PHPackages © 2026

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