Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installation Guzzle in Laravel 5

how to Install Guzzle into Laravel 5? I'm using laravel for my project, but I need library like guzzle to made me easy using curl in laravel. Any Body can help?

like image 421
Rahman Avatar asked Jul 31 '15 08:07

Rahman


People also ask

What is laravel guzzle?

Laravel provides an expressive, minimal API around the Guzzle HTTP client, allowing you to quickly make outgoing HTTP requests to communicate with other web applications. Laravel's wrapper around Guzzle is focused on its most common use cases and a wonderful developer experience.

What is GuzzleHttp guzzle?

Guzzle is a PHP HTTP client that makes it easy to send HTTP requests and trivial to integrate with web services. Simple interface for building query strings, POST requests, streaming large uploads, streaming large downloads, using HTTP cookies, uploading JSON data, etc...

How install guzzle in codeigniter?

//Create guzzle http client $client = new \GuzzleHttp\Client(); $res = $client->request('GET', 'https://api.github.com/user', [ 'auth' => ['user', 'pass'] ]); echo $res->getStatusCode(); // "200" echo $res->getHeader('content-type')[0]; // 'application/json; charset=utf8' echo $res->getBody(); // {"type":"User"...'

Does guzzle use cURL?

Guzzle has historically only utilized cURL to send HTTP requests. cURL is an amazing HTTP client (arguably the best), and Guzzle will continue to use it by default when it is available. It is rare, but some developers don't have cURL installed on their systems or run into version specific issues.


2 Answers

Open a terminal, change into your laravel projects root dir and type

composer require guzzlehttp/guzzle

Alternatively, you can add

"guzzlehttp/guzzle":"*"

to your composer.json file's require section and run composer update.

like image 150
baao Avatar answered Oct 23 '22 10:10

baao


Via composer, cd into your laravel's project root directory, then

composer require guzzlehttp/guzzle

That's much it. Now guzzle is installed and ready to use.

like image 9
FaizFizy Avatar answered Oct 23 '22 08:10

FaizFizy