php - Fatal error: Call to undefined method GuzzleHttp\Client::request() with Guzzle 6 -


i'm using guzzle 6 laravel 5.2.

i'm trying access simple internal api:

use guzzlehttp\client;          $client = new client(['base_uri' => getenv('url_base').'api/v1/']);         $response = $client->request('get', 'tournaments'); 

and message:

fatal error: call undefined method guzzlehttp\client::request() 

when see docs, says:

$client = new guzzlehttp\client(['base_uri' => 'https://foo.com/api/']); 

but phpstorm cannot resolve guzzlehttp

what should make work???

i using guzzle, , working me, try this

use guzzlehttp; use guzzlehttp\subscriber\oauth\oauth1;  $client = new guzzlehttp\client(); 

and response try this

$response = $client->request('get', 'tournaments',['query' => ['base_uri' => getenv('url_base').'api/v1/']]); 

or try if not work

$response = $client->request('get', getenv('url_base').'api/v1/tournaments'); 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -