دعم الموقع

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?

10 ردود (على هذه الصفحة 1 من 1)

Jump to last post

Hi Luke,

I'm not sure. Everything looks fine to me. How are you making the request?

tbell$ curl -v "https://api.themoviedb.org/3/genre/movie/list?api_key=###"
*   Trying 54.225.152.113...
* Connected to api.themoviedb.org (54.225.152.113) port 443 (#0)
* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
* Server certificate: *.themoviedb.org
* Server certificate: RapidSSL SHA256 CA
* Server certificate: GeoTrust Global CA
> GET /3/genre/movie/list?api_key=### HTTP/1.1
> Host: api.themoviedb.org
> User-Agent: curl/7.43.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Access-Control-Allow-Origin: *
< Cache-Control: public, max-age=28800
< Content-Type: application/json;charset=utf-8
< Date: Sat, 13 Aug 2016 15:37:27 GMT
< ETag: "43f17b8c287f6cc19a0d5db8802a0815"
< Server: openresty
< Status: 200 OK
< X-Memc: HIT
< X-Memc-Age: 9497
< X-Memc-Expires: 19303
< X-Memc-Key: 35d4905f7b79deee175de1f8c34b463b
< X-RateLimit-Limit: 40
< X-RateLimit-Remaining: 39
< X-RateLimit-Reset: 1471102657
< Content-Length: 577
< Connection: keep-alive
<
* Connection #0 to host api.themoviedb.org left intact
{"genres":[{"id":28,"name":"Action"},{"id":12,"name":"Adventure"},{"id":16,"name":"Animation"},{"id":35,"name":"Comedy"},{"id":80,"name":"Crime"},{"id":99,"name":"Documentary"},{"id":18,"name":"Drama"},{"id":10751,"name":"Family"},{"id":14,"name":"Fantasy"},{"id":10769,"name":"Foreign"},{"id":36,"name":"History"},{"id":27,"name":"Horror"},{"id":10402,"name":"Music"},{"id":9648,"name":"Mystery"},{"id":10749,"name":"Romance"},{"id":878,"name":"Science Fiction"},{"id":10770,"name":"TV Movie"},{"id":53,"name":"Thriller"},{"id":10752,"name":"War"},{"id":37,"name":"Western"}]}

Here it is:

var promise = $.Deferred();
    Ember.$.ajax({
        type: 'GET',
        url: 'https://api.themoviedb.org/3/genre/movie/list&api_key=#####',
        async: false,
        contentType: 'application/json',
        dataType: 'jsonp'
    }).then(function (response) {
        console.log(response)
        promise.resolve(response);
    })
    return promise.promise();
}

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).

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.

No, it is not necessary. It was accidentally left from a previous example.

That's not a valid HTTP request. You're looking for:

https://api.themoviedb.org/3/genre/movie/list?api_key=####&callback=jQuery22408132628371243029_1471207855881&_=1471207855884

forgive me. I am not seeing a difference between your request and my request

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.

thanks for your help. that fixed it

لم تجد الفلم أو المسلسل ؟ سجل دخولك و انشئها

عام

s ركز شريط البحث
p افتح قائمة الملف الشخصي
esc اغلق النافذة المفتوحة
? افتح نافذة اختصارات لوحة المفاتيح

على كافة صفحات الوسائط

b ارجع للخلف (او للصفحة الام عند التطبيق)
e انتقل لصفحة التعديل

على كافة صفحات موسم المسلسل

(السهم الايمن) انتقل للموسم التالي
(السهم الايسر) انتقل للموسم السابق

على كافة صفحات حلقة المسلسل

(السهم الايمن) انتقل للحلقة التالية
(السهم الايسر) انتقل للحلقة السابقة

على كافة صفحات الصور

a افتح صفحة اضافة الصورة

على كافة صفحات التعديل

t افتح محدد الترجمة
ctrl+ s ارسال النموذج

على صفحات المناقشة

n انشى نقاش جديد
w تبديل حالة المتابعة
p تبديل عام / خاص
c تبديل اغلاق / فتح
a افتح الانشطة
r رد على النقاش
l انتقل لأخر رد
ctrl+ enter أرسل رسالتك
(السهم الايمن) الصفحة التالية
(السهم الايسر) الصفحة السابقة

الاعدادات

هل تريد تقييم او اضافة هذا العنصر للقائمة؟

تسجيل الدخول