2017 © Pedro Peláez
 

library http-message

PSR-7 Library

image

dspacelabs/http-message

PSR-7 Library

  • Tuesday, June 27, 2017
  • by joshuaestes
  • Repository
  • 1 Watchers
  • 1 Stars
  • 282 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 1 % Grown

The README.md

dspacelabs/http-message Build Status

This is a simple, very basic implementation of the PSR-7 standard. This library does not come with a client and only deals with the messages., (*1)

Installation

composer require dspacelabs/http-message

Examples

Creating URIs

use Dspacelabs\Component\Http\Message\Uri;

$uri = (new Uri())
    ->withScheme('http')
    ->withHost('www.example.com');

If you want something less verbose, you can also pass in the URL when creating new Uri objects., (*2)

use Dspacelabs\Component\Http\Message\Uri;

$uri = new Uri('http://www.example.com');

Creating Requests

use Dspacelabs\Component\Http\Message\Uri;
use Dspacelabs\Component\Http\Message\Request;

$request = new Request();
$request
    ->withMethod('GET')
    ->withUri(new Uri('http://www.example.com'));

Creating Responses

use Dspacelabs\Component\Http\Message\Response;

$resposne = new Response();
$response
    ->withStatus(200, 'OK');

Testing

Testing is done with PHPUnit and Phing. Once you make updates, run the command, (*3)

./vendor/bin/phing

And this will run PHPUnit and give you test results., (*4)

The Versions

27/06 2017

dev-master

9999999-dev https://github.com/dSpaceLabs/http-message

PSR-7 Library

  Sources   Download

MIT

The Requires

 

The Development Requires

psr7

20/06 2017

v0.2.0

0.2.0.0 https://github.com/dSpaceLabs/http-message

PSR-7 Library

  Sources   Download

MIT

The Requires

 

The Development Requires

psr7

18/06 2017

v0.1.0

0.1.0.0 https://github.com/dSpaceLabs/http-message

PSR-7 Library

  Sources   Download

MIT

The Requires

 

The Development Requires

psr7