A psr-18 compliant client with the native stream engine.
A psr-18 compliant client with the native stream engine.
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.
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
MIT (See license file).