2017 © Pedro Peláez
 

library http

PSR7 http-messages implementation

image

codejet/http

PSR7 http-messages implementation

  • Thursday, January 5, 2017
  • by Houghtelin
  • Repository
  • 2 Watchers
  • 0 Stars
  • 5 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Http

Latest Version on Packagist ![Software License][ico-license] Build Status ![Coverage Status][ico-scrutinizer] Quality Score ![Total Downloads][ico-downloads], (*1)

This is a Work In Progress., (*2)

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, (*3)

Install

Via Composer, (*4)

``` bash $ composer require codejet/http, (*5)


## Usage ### Uri Using the Uri class itself. ``` php $uri = new CodeJet\Http\Uri('https://www.example.com'); echo $uri;

Or, using the http-interop proposed factory., (*6)

``` php $uri = new CodeJet\Http\Factory\UriFactory('https://www.example.com'); echo $uri;, (*7)


### Request Creating a request using the PSR7 RequestInterface methods. ``` php $request = (new CodeJet\Http\Request())->withMethod('POST')->withUri($uri); echo $uri;

Stream

Using the class constructor., (*8)

``` php $handle = fopen('php://input','r'); $stream = new CodeJet\Http\Stream($handle);, (*9)


Or, using the [http-interop proposed StreamFactory](https://github.com/http-interop/http-factory). From a string: ``` php $string = "I love lamp."; $stream = (new CodeJet\Http\Factory\StreamFactory())->createStream($string);

From a file: ``` php $stream = (new CodeJet\Http\Factory\StreamFactory())->createStreamFromFile('php://input', 'r');, (*10)


From a resource handle: ``` php $handle = fopen('php://input','r'); $stream = (new CodeJet\Http\Factory\StreamFactory())->createStreamFromResource($handle);

Change log

Please see CHANGELOG for more information on what has changed recently., (*11)

Testing

bash $ composer test, (*12)

Contributing

Please see CONTRIBUTING for details., (*13)

Security

If you discover any security related issues, please email josh@findsomehelp.com instead of using the issue tracker., (*14)

License

The MIT License (MIT). Please see License File for more information., (*15)

The Versions

05/01 2017

dev-response

dev-response

PSR7 http-messages implementation

  Sources   Download

MIT

The Requires

 

The Development Requires

http codejet

04/01 2017

dev-master

9999999-dev

PSR7 http-messages implementation

  Sources   Download

MIT

The Requires

 

The Development Requires

http codejet

04/01 2017

dev-implement-stream

dev-implement-stream

PSR7 http-messages implementation

  Sources   Download

MIT

The Requires

 

The Development Requires

http codejet

30/12 2016

0.0.1

0.0.1.0

PSR7 http-messages implementation

  Sources   Download

MIT

The Requires

 

The Development Requires

http codejet