componenta/http-body-parsing-middleware
Composer 安装命令:
composer require componenta/http-body-parsing-middleware
包简介
PSR-15 request body parsing middleware for Componenta
README 文档
README
PSR-15 middleware for parsing HTTP request bodies into PSR-7 parsed body and uploaded files. It supports JSON, application/x-www-form-urlencoded, and multipart/form-data.
Use this package in HTTP applications that need parsed bodies for methods and content types PHP does not parse natively.
Installation
composer require componenta/http-body-parsing-middleware
The package exposes Componenta\Http\Middleware\BodyParsingConfigProvider through Composer metadata.
Configuration
The config provider registers BodyParsingMiddleware from:
StreamFactoryInterfaceUploadedFileFactoryInterface
Install one PSR-7/PSR-17 integration package so these factories exist in the container.
Runtime Behavior
The middleware skips requests when:
getParsedBody()is already set;- the method is
GET,HEAD,OPTIONS, orTRACE; - PHP has already parsed a native
POSTform or multipart request.
Scalar JSON values are preserved under the __scalar key because PSR-7 parsed bodies must be null, array, or object.
Public Classes
BodyParsingMiddlewareis the PSR-15 middleware.Body\MultipartParserparses multipart bodies.Body\MultipartPartrepresents one multipart part.
Related Packages
componenta/http-psrwires server request creation.componenta/app-httpruns HTTP middleware.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-06-14