Download the PHP package kigkonsult/http-message without Composer
On this page you can find all versions of the php package kigkonsult/http-message. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kigkonsult/http-message
More information about kigkonsult/http-message
Files in kigkonsult/http-message
Package http-message
Short Description Psr http-message server-side message, response and stream implementation
License LGPL-3.0-or-later
Homepage https://kigkonsult.se
Informations about the package http-message
The Kigkonsult\Http\Message package provide PSR server-side
Message class
Stream class
Response class
Message class
- implements Psr\Http\Message\MessageInterface
- constructor args: body, headers, protocolVersion
Stream class
- implements Psr\Http\Message\StreamInterface
- constructor args: content, streamWrapper/resource, mode
- with a (static) factory methods
factoryFromString( content [, streamWrapper [, mode ]] )
factoryFromResource( resource )
Response class
- extends Message
- implements
- constructor args: body, status, headers
The Response class has an added property:
rawBody
- response body (type mixed) before serialization/encoding
in parallel with
(Psr\Http\Message\)ServerRequest::parsedBody
(Psr\Http\Message\)ServerRequest::body
with corresponding methods:
getRawBody()
- Return rawBody
isRawBodyEmpty()
- Return bool true on empty rawBody
withRawBody()
- Return new instance with rawBody
and two rawBody/body methods
getResponseBody()
- Return rawBody if not empty else body
isBodyEmpty()
- Return bool true if (serialized/encoded) body is empty
Two statusCode methods are added:
assertStatusCode()
- (static) validates statusCode, throws InvalidArgumentException on error
isBodyLessResponse()
- Return bool true on statusCode 1xx, 204 or 304
Installation
Composer, from the Command Line:
Composer, in your composer.json
:
Composer, acquire access
Otherwise , download and acquire..
Support
For support use github.com http-master. Non-emergence support issues are, unless sponsored, fixed in due time.
Sponsorship
Donation using paypal.me/kigkonsult are appreciated. For invoice, please e-mail.
License
This project is licensed under the LGPLv3 License