Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

160
Vistas
Fetch data from Api in react

I want to fetch the data from this api (refer the screenshots) in reactjs using fetch function..I tried different ways but none of them is working

I am doing this way

useEffect(() => {
    // POST request using fetch inside useEffect React hook
    const requestOptions = {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({ "firebase_id":"fonnnnjnvQXzyOcXK5kW88PM8jnjnhnhb1"})
    };
    fetch('demo.revon.com/audi/zero/li', requestOptions)
        .then(response => response.json())
        .then(data =>  console.log(data));                 
about 4 years ago · Juan Pablo Isaza
3 Respuestas
Responde la pregunta

0

requestOptions is not the issue here!


You are OBVIOUSLY hitting the localhost domain, not demo.revon.
Insert the full URL: https://demo.revon.com/audi/zero/li

about 4 years ago · Juan Pablo Isaza Denunciar

0

You should try to call your API without https://localhost:3000 in front of your API link.

You forgot to put HTTP or HTTPS so it consider a subfolder of localhost:3000.

You must do something like that : (or http if not https)

fetch('https://demo.revon.com/audi/zero/li', requestOptions)
        .then(response => response.json())
        .then(data =>  console.log(data));    

Regards

about 4 years ago · Juan Pablo Isaza Denunciar

0

You’ll need to mention https:// in the fetch url

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda