Soporte de 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 respuestas (en la página 1 de 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

¿No encuentras una película o serie? Inicia sesión para crearla:

Global

s centrar la barra de búsqueda
p abrir menú de perfil
esc cierra una ventana abierta
? abrir la ventana de atajos del teclado

En las páginas multimedia

b retrocede (o a padre cuando sea aplicable)
e ir a la página de edición

En las páginas de temporada de televisión

(flecha derecha) ir a la temporada siguiente
(flecha izquierda) ir a la temporada anterior

En las páginas de episodio de televisión

(flecha derecha) ir al episodio siguiente
(flecha izquierda) ir al episodio anterior

En todas las páginas de imágenes

a abrir la ventana de añadir imagen

En todas las páginas de edición

t abrir la sección de traducción
ctrl+ s enviar formulario

En las páginas de debate

n crear nuevo debate
w cambiar el estado de visualización
p cambiar público/privado
c cambiar cerrar/abrir
a abrir actividad
r responder al debate
l ir a la última respuesta
ctrl+ enter enviar tu mensaje
(flecha derecha) página siguiente
(flecha izquierda) página anterior

Configuraciones

¿Quieres puntuar o añadir este elemento a una lista?

Iniciar sesión