aurora / http-codec
Decode raw request message and encode raw response message
dev-master / 1.0.x-dev
2018-02-03 07:25 UTC
Requires
- php: >=7.0
- aurora/http-foundation: ~0.1
- panlatent/context: ~1.0
- psr/http-message: ~1.0
Requires (Dev)
- php-coveralls/php-coveralls: ^2.0
- phpunit/phpunit: ^6.5
This package is auto-updated.
Last update: 2024-11-19 10:56:36 UTC
README
Decode raw request message and encode PRS-7 response object.
! The HTTP 2.0 part is under development and not yet supported.
Installation
It's recommended that you use Composer to install this library.
$ composer require aurora/http-codec
This will install the library and all required dependencies. The library requires PHP 7.0 or newer.
Usage
Decode raw Http message content to a request object:
$stream = new Aurora\Http\Decoder\Stream(); $stream = $stream->write($rawHttpMessage); $decoder = new Aurora\Http\Decoder\Decoder(); $serverRequest = $decoder->decode($stream);
Encode a response object to stream:
$encoder = new Aurora\Http\Decoder\Encoder(); $stream = $encoder->encode($response);
License
The HTTP Codec is open-sourced software licensed under the MIT license.