This is my code, I'm using it in a react redux app.
const devOptions = {
url: `${TMDB_URL}${TMDB_API_KEY}${TMDB_LANGUAGE}&query=${searchTerm}${TMDB_SEARCH_PARAMS}`,
method: 'GET',
dataType: 'jsonp',
jsonpCallback: 'test'
}
const request = axios(devOptions)
Still getting cors issue with datatype as jsonp.
Un film, une émission télévisée ou un artiste est introuvable ? Connectez-vous afin de créer une nouvelle fiche.
Vous souhaitez évaluer ou ajouter cet élément à une liste ?
Pas encore membre ?
Réponse de martymclaugh@gmail.com
le 26 janvier 2017 à 20h43
I have no idea why, but it started working once I took out "method: 'GET'"
Réponse de Travis Bell
le 28 janvier 2017 à 11h25
That is weird, must be some kind of policy that is enforced in one case, but not the other. In any case, I believe I have an open ticket to look at this.
Regardless, I'm happy you figured out a way around it ;)
Réponse de martymclaugh@gmail.com
le 28 janvier 2017 à 16h28
It's even working without the jsonp datatype from localhost now,
Works just fine. Maybe it has something to do with the promise middleware I added to redux?
Réponse de Travis Bell
le 29 janvier 2017 à 11h41
Maybe! But I don't know anything about React so...