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.
.לא מצאת סרט או סדרה? היכנס כדי ליצור אותם
?רוצה לדרג או להוסיף פריט אל רשימה
?לא חבר אתר
תגובה מאת martymclaugh@gmail.com
ב-ינואר 26, 2017 ב-8:43אחרי חצות יום
I have no idea why, but it started working once I took out "method: 'GET'"
תגובה מאת Travis Bell
ב-ינואר 28, 2017 ב-11:25לפני חצות יום
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 ;)
תגובה מאת martymclaugh@gmail.com
ב-ינואר 28, 2017 ב-4:28אחרי חצות יום
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?
תגובה מאת Travis Bell
ב-ינואר 29, 2017 ב-11:41לפני חצות יום
Maybe! But I don't know anything about React so...