sunrise/http-message

HTTP message wrapper for PHP 7.1+ based on RFC-7230, PSR-7 and PSR-17

v2.1.3 2022-04-19 19:10 UTC

README

Build Status Code Coverage Scrutinizer Code Quality Total Downloads Latest Stable Version License

Installation

composer require 'sunrise/http-message:^2.0'

How to use?

Request message

use Sunrise\Http\Message\RequestFactory;

$message = (new RequestFactory)->createRequest('GET', 'http://php.net/');

// just use PSR-7 methods...

Response message

use Sunrise\Http\Message\ResponseFactory;

$message = (new ResponseFactory)->createResponse(200, 'OK');

// just use PSR-7 methods...

Related packages

Headers as objects

Test run

composer test

Useful links