The Movie Database Подршка

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 пошаљи поруку
(стрелица надесно) следећа страница
(лева стрелица) претходна страница

Подешавања

Желите ли да оцените или додате ову ставку у листу?

Пријави се