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

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -

Nuget pack csproj using nuspec -