php-extended/php-http-client-native

A psr-18 compliant client with the native stream engine.


Keywords
php, http, stream, client, message, engine, native, psr7, psr18
License
MIT

Documentation

php-http-client-native

A psr-18 compliant client with the native stream engine.

Installation

The installation of this library is made via composer. Download composer.phar from their website. Then add to your composer.json :

	"require": {
		...
		"php-extended/php-http-client-native": "^2",
		...
	}

Then run php composer.phar update to install this library. The autoloading of all classes of this library is made through composer's autoloader.

Basic Usage

This library uses the internal file_get_contents with the http resource context to perform http requests. You may use it the following way :


use PhpExtended\HttpClient\NativeClient;

// $request is an instance of Psr\Http\Message\Request (psr-7)

$client = new NativeClient();
$response = $client->sendRequest($request);

// $response is an instance of Psr\Http\Message\Response

License

MIT (See license file).