Composer Require Guzzlehttp/guzzle Laravel 6 Code Example


Example 1: composer require guzzlehttp/guzzle


To install guzzlehttp
composer require guzzlehttp/guzzle

Ref : https://packagist.org/packages/guzzlehttp/guzzle

Example 2: use guzzle http client laravel


public function putGuzzleRequest()

{

$client = new \GuzzleHttp\Client();

$url = "http://myexample.com/api/posts/1";

$myBody['name'] = "Demo";

$request = $client->put($url, ['body'=>$myBody]);

$response = $request->send();



dd($response);

}

Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android How Can I Convert A String To A Editable