承接 kekos/parse-request-body-middleware 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

kekos/parse-request-body-middleware

最新稳定版本:v2.1.0

Composer 安装命令:

composer require kekos/parse-request-body-middleware

包简介

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

README 文档

README

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

You can install this package via Composer:

composer require kekos/multipart-form-data-parser

Documentation

Supported content types native PHP

MIME type POST PUT/PATCH
application/json
application/x-www-form-urlencoded *
multipart/form-data *

* Supported by calling request_parse_body() in PHP >= 8.4

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 type POST PUT/PATCH
application/json
application/x-www-form-urlencoded
multipart/form-data

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

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

License

MIT

统计信息

  • 总下载量: 671
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 2
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-07-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固