2017 © Pedro Peláez
 

library http

Objects to easy manipulate by HTTP-requests and responses

image

jamm/http

Objects to easy manipulate by HTTP-requests and responses

  • Monday, August 10, 2015
  • by OZ
  • Repository
  • 4 Watchers
  • 22 Stars
  • 46 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 4 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

HTTP

Objects to easy manipulate by HTTP-requests and responses, (*1)

Example of sending request:, (*2)

$Response = new Response();
$Request  = new Request();
$Request->setMethod(Request::method_POST);
$Request->setHeader('Authorization', 'auth_token');
$Request->setDataKey('some_post_key', 'some value');
$Request->Send('https://api.example.com', $Response);

print $Response->getBody();

Features

Headers in Request and Response are case-insensitive:, (*3)

$Request->setHeader('Authorization', 'token');  
$Request->setHeader('authorization', 'auth_token');  

// second line will not create new header and will update existing one    
// $Request->getHeaders('AUTHORIZATION') will return:    
// auth_token  

Body of response can be automatically unpacked from JSON or XML, (*4)

// next line will create header Accept: JSON in request,
// and body of response will be automatically decoded from JSON

$Response->setSerializer(new SerializerJSON());

SSL support
Easy to test and extend, (*5)

License

MIT, (*6)

The Versions

10/08 2015

dev-master

9999999-dev

Objects to easy manipulate by HTTP-requests and responses

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

api json rest ajax http request response

16/04 2014

1.0.0

1.0.0.0

Objects to easy manipulate by HTTP-requests and responses

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

api json rest ajax http request response