I am just making a basic ajax call to 'http://api.themoviedb.org/3/genre/movie/list&api_key=#####' I keep getting a 'Cannot get' error? what am I doing wrong?
Nem találsz egy filmet vagy egy sorozatot? Jelentkezz be és hozd létre.
Want to rate or add this item to a list?
Még nem tag?
Travis Bell válaszolt
Beküldve: 2016. augusztus 13. 11:38
Hi Luke,
I'm not sure. Everything looks fine to me. How are you making the request?
luke_simmon válaszolt
Beküldve: 2016. augusztus 13. 14:14
Here it is:
Travis Bell válaszolt
Beküldve: 2016. augusztus 14. 11:15
Even though you have your dataType set to jsonp, is is sending along a callback?
This test of mine here is working fine (make sure to replace your API key on line 11).
luke_simmon válaszolt
Beküldve: 2016. augusztus 14. 11:47
I am using the api in many other instances, genre has been the only on genre. I see that you added a query at the end, is that necessary? I am trying to get the list of genres to use for the movies gennre codes that I get.
Travis Bell válaszolt
Beküldve: 2016. augusztus 14. 13:55
No, it is not necessary. It was accidentally left from a previous example.
luke_simmon válaszolt
Beküldve: 2016. augusztus 14. 18:53
Cannot GET https://api.themoviedb.org/3/genre/movie/list&api_key=####?callback=jQuery22408132628371243029_1471207855881&_=1471207855884
Travis Bell válaszolt
Beküldve: 2016. augusztus 15. 00:22
That's not a valid HTTP request. You're looking for:
luke_simmon válaszolt
Beküldve: 2016. augusztus 15. 16:08
forgive me. I am not seeing a difference between your request and my request
Travis Bell válaszolt
Beküldve: 2016. augusztus 15. 19:26
You're starting your query string with an ampersand. That's not valid HTTP, so it's ignoring your API key param and only reading from the question mark and on. In my example, I fixed that for you.
luke_simmon válaszolt
Beküldve: 2016. augusztus 16. 13:39
thanks for your help. that fixed it