php - Guzzle 6 request to TMDB -
i try make request movie database api.
here url access guzzle http://api.themoviedb.org/3/movie/21208?api_key=my-key
http://docs.themoviedb.apiary.io/#reference/movies/movieid/get
if if try url normal in browser, works. in guzzle became 204
status code "no content".
here guzzle code:
$client = new \guzzlehttp\client(['base_uri' => 'http://api.themoviedb.org/']); $response = $client->get('/3/movie/' + $id, ['query' => ['api_key' => 'my-key']]); dd($response);
something helpful use apiary debugging proxy. make request in browser private apiary address (http://private-xxx-themoviedb.apiary-proxy.com/) , 1 guzzle. trace both requests you, , can compare difference see guzzle doing.
Comments
Post a Comment