Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel Guzzle GET request

    $client = new Client(['base_uri' => 'http://api.tvmaze.com/']);

    $res = $client->request('GET', '/schedule?country=US&date=2014-12-01');

    return $res;

returns this error:

"Class 'Symfony\Bridge\PsrHttpMessage\Factory\HttpFoundationFactory' not found"

I've tried including "symfony/psr-http-message-bridge": "0.2", in my composer.json file

like image 597
johnstones12 Avatar asked Jul 13 '18 19:07

johnstones12


1 Answers

You need to get the body of the answer:

$client = new \GuzzleHttp\Client(['base_uri' => 'http://api.tvmaze.com/']);

$res = $client->request('GET', '/schedule?country=US&date=2014-12-01');

return $res->getBody();
like image 134
Cristian Camilo Echeverri Avatar answered Oct 21 '22 06:10

Cristian Camilo Echeverri