项目作者: yiisoft

项目描述 :
Middleware for parsing various data formats
高级语言: PHP
项目地址: git://github.com/yiisoft/request-body-parser.git
创建时间: 2020-07-08T12:19:36Z
项目社区:https://github.com/yiisoft/request-body-parser

开源协议:BSD 3-Clause "New" or "Revised" License

下载




Yii

Yii Request Body Parser




Latest Stable Version
Total Downloads
Build status
Code coverage
Mutation testing badge
static analysis
type-coverage

The package is PSR-15 middleware that allows parsing PSR-7
server request body selecting the parser according to the server request mime type.

Requirements

  • PHP 7.4 or higher.

Installation

The package could be installed with Composer:

  1. composer require yiisoft/request-body-parser

General usage

  1. Add RequestBodyParser to your middleware stack.
  2. Obtain parsed body via $request->getParsedBody();.

By default, it parses application/json requests where JSON is in the body.

You can add your own parser by implementing ParserInterface, adding it into the container and registering it within
the middleware:

  1. $requestBodyParser = $requestBodyParser->withParser('application/myformat', MyFormatParser::class);

Documentation

If you need help or have a question, the Yii Forum is a good place for that.
You may also check out other Yii Community Resources.

License

The Yii Request Body Parser is free software. It is released under the terms of the BSD License.
Please see LICENSE for more information.

Maintained by Yii Software.

Support the project

Open Collective

Follow updates

Official website
Twitter
Telegram
Facebook
Slack