- Provides a http client interface adapter for guzzle
- PHP 5.3+
- Guzzle ~5.0 (PHP 5.4+)
Through Composer as saxulum/saxulum-http-client-adapter-guzzle.
use Saxulum\HttpClient\Guzzle\HttpClient;
use Saxulum\HttpClient\Request;
$httpClient = new HttpClient();
$response = $httpClient->request(new Request(
'1.1',
Request::METHOD_GET,
'http://en.wikipedia.org',
array(
'Connection' => 'close',
)
));
You can inject your own guzzle client instance while creating the http client instance.
use GuzzleHttp\Client;
use Saxulum\HttpClient\Guzzle\HttpClient;
$client = new Client;
$httpClient = new HttpClient($client);