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?
لم تجد الفلم أو المسلسل ؟ سجل دخولك و انشئها
هل تريد تقييم او اضافة هذا العنصر للقائمة؟
لست عضو؟
رد بواسطة Travis Bell
بتاريخ أغسطس 13, 2016 في 11:38 صباحا
Hi Luke,
I'm not sure. Everything looks fine to me. How are you making the request?
رد بواسطة luke_simmon
بتاريخ أغسطس 13, 2016 في 2:14 مساءا
Here it is:
رد بواسطة Travis Bell
بتاريخ أغسطس 14, 2016 في 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
بتاريخ أغسطس 14, 2016 في 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
بتاريخ أغسطس 14, 2016 في 1:55 مساءا
No, it is not necessary. It was accidentally left from a previous example.
رد بواسطة luke_simmon
بتاريخ أغسطس 14, 2016 في 6:53 مساءا
Cannot GET https://api.themoviedb.org/3/genre/movie/list&api_key=####?callback=jQuery22408132628371243029_1471207855881&_=1471207855884
رد بواسطة Travis Bell
بتاريخ أغسطس 15, 2016 في 12:22 صباحا
That's not a valid HTTP request. You're looking for:
رد بواسطة luke_simmon
بتاريخ أغسطس 15, 2016 في 4:08 مساءا
forgive me. I am not seeing a difference between your request and my request
رد بواسطة Travis Bell
بتاريخ أغسطس 15, 2016 في 7: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
بتاريخ أغسطس 16, 2016 في 1:39 مساءا
thanks for your help. that fixed it