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.
Non riesci a trovare un film o una serie Tv? Accedi per crearlo.
Vuoi valutare o aggiungere quest'elemento a una lista?
Non sei un membro?
Risposta da martymclaugh@gmail.com
il 26 gennaio, 2017 alle 8:43PM
I have no idea why, but it started working once I took out "method: 'GET'"
Risposta da Travis Bell
il 28 gennaio, 2017 alle 11:25AM
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 ;)
Risposta da martymclaugh@gmail.com
il 28 gennaio, 2017 alle 4:28PM
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?
Risposta da Travis Bell
il 29 gennaio, 2017 alle 11:41AM
Maybe! But I don't know anything about React so...