It becomes easier with Guzzle, which is a PHP HTTP, to send HTTP requests. Moreover, one can easily perform the task of integrating with web services. Guzzle enables to send both synchronous and asynchronous requests.
Guzzle using Laravel 4.x:
You dont need to add Guzzle to your composer.json when using Laravel 4.x. The hassle is eliminated because of autoloading by it's own composer.json.
Guzzle 4
Requirment: PHP 5.4.x+ required
Command:
composer require "guzzlehttp/guzzle" "~4.0"
Then we will create a command.
$client = new \GuzzleHttp\Client();
Get results:
$response = $client->get('http://api.github.com/users/antonioribeiro');
dd($response->getBody());
By this way we will autoload Guzzle in Laravel 4.
0 Comment(s)