Assistance de TMDB

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 réponses (sur la page 1 sur 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

Un film, une émission télévisée ou un artiste est introuvable ? Connectez-vous afin de créer une nouvelle fiche.

Général

s Mettre le curseur dans la barre de recherche
p Ouvrir le menu du profil
esc Fermer une fenêtre ouverte
? Ouvrir la fenêtre des raccourcis clavier

Sur les pages des médias

b Retour (ou vers le parent si faisable)
e Afficher la page de modification

Sur les pages des saisons des émissions télévisées

Afficher la saison suivante (flèche droite)
Afficher la saison précédente (flèche gauche)

Sur les pages des épisodes des émissions télévisées

Afficher l'épisode suivant (flèche droite)
Afficher l'épisode précédent (flèche gauche)

Sur toutes les pages des images / photos

a Ouvrir la fenêtre d'ajout d'image / photo

Sur toutes les pages de modifications

t Ouvrir le sélecteur de traduction
ctrl+ s Envoyer le formulaire

Sur les pages des discussions

n Créer une nouvelle discussion
w Basculer le statut de suivi
p Basculer publique / privée
c Basculer fermer / ouvrir
a Ouvrir l'activité
r Répondre à la discussion
l Afficher la dernière réponse
ctrl+ enter Envoyer votre message
Page suivante (flèche droite)
Page précédente (flèche gauche)

Paramètres

Vous souhaitez évaluer ou ajouter cet élément à une liste ?

Connexion