This is a Work In Progress.
This is an exercise in understanding the http-interop related standards and is an implementation of PSR-7 HTTP message interfaces and HTTP-Factory Interfaces
Via Composer
$ composer require codejet/http
Using the Uri class itself.
$uri = new CodeJet\Http\Uri('https://www.example.com');
echo $uri;
Or, using the http-interop proposed factory.
$uri = new CodeJet\Http\Factory\UriFactory('https://www.example.com');
echo $uri;
Creating a request using the PSR7 RequestInterface methods.
$request = (new CodeJet\Http\Request())->withMethod('POST')->withUri($uri);
echo $uri;
Using the class constructor.
$handle = fopen('php://input','r');
$stream = new CodeJet\Http\Stream($handle);
Or, using the http-interop proposed StreamFactory.
From a string:
$string = "I love lamp.";
$stream = (new CodeJet\Http\Factory\StreamFactory())->createStream($string);
From a file:
$stream = (new CodeJet\Http\Factory\StreamFactory())->createStreamFromFile('php://input', 'r');
From a resource handle:
$handle = fopen('php://input','r');
$stream = (new CodeJet\Http\Factory\StreamFactory())->createStreamFromResource($handle);
Please see CHANGELOG for more information on what has changed recently.
$ composer test
Please see CONTRIBUTING for details.
If you discover any security related issues, please email josh@findsomehelp.com instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.