I've built a small Laravel project to get data from an open API and return it with the right CORS headers and such. So I'm doing this:
$client = new Client();
$res = $client->get('http://ift.tt/2sG87Wk' . $call);
return response()->json(json_decode($res->getBody()))->withHeaders($res->getHeaders());
When I make an example call, it returns a weird response, starting with <?php
followed by the actual JSON response. Why does this happen?
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2rW46Qs
via IFTTT
Aucun commentaire:
Enregistrer un commentaire