- Provides a http client interface adapter for zend
- PHP 5.3+
- Zend Http ~2.3
Through Composer as saxulum/saxulum-http-client-adapter-zend.
use Saxulum\HttpClient\Zend\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 zend client instance while creating the http client instance.
use Zend\Http\Client;
use Saxulum\HttpClient\Zend\HttpClient;
$client = new Client;
$httpClient = new HttpClient($client);