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