Using GuzzleHttp with Laravel

Tu Chu
Laravel — In right way
1 min readApr 21, 2016


Guzzle is a PHP HTTP client that makes it easy to send HTTP requests and trivial to integrate with web services.

Here is the steps list that you need to do to make it work with Laravel

  • Go to your root of Laravel project
  • Install Guzzle package via composer :
# If you don't have composercurl -sS | php
php composer.phar require guzzlehttp/guzzle
# If you already have composer installed globally
composer require guzzlehttp/guzzle
  • Use its namespace
use GuzzleHttp\Exception\GuzzleException;
use GuzzleHttp\Client;
  • Then use it easily, e.g :
$client = new Client(); //GuzzleHttp\Client
$result = $client->post('your-request-uri', [
'form_params' => [
'sample-form-data' => 'value'
  • That’s it. You could do more with Guzzle. Check its latest doc then master it



Tu Chu
Laravel — In right way

“Mind-reading” products/engineers leader, a lifelong learner and a go-giver.

Recommended from Medium