Soporte de The Movie Database

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.

4 respuestas (en la página 1 de 1)

Jump to last post

I have no idea why, but it started working once I took out "method: 'GET'"

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 ;)

It's even working without the jsonp datatype from localhost now,

  const url = `${TMDB_URL_SEARCH}${TMDB_API_KEY}${TMDB_LANGUAGE}&query=${searchTerm}${TMDB_SEARCH_PARAMS}`
  const request = axios(url);
  return {
    type: FETCH_TMDB,
    payload: request
  };

Works just fine. Maybe it has something to do with the promise middleware I added to redux?

Maybe! But I don't know anything about React so... man_shrugging_tone2

¿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