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

205
Vistas
Can't display image from API call React Js

I'm trying to display images from API call, response.json() returns img sources as

{"imgSrc":"/rimg/source/cars/v/1.jpg?crop=false&width=55&height=92&fallback=default3.png&_v=45788f99e6dcc"

}

and when I use it as src, images are broken and are not displayed. Any help and advise is greatly appreciated.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

This is because the images locations returned are relative. You have 2 possible solutions:

  • Either you make your server return the complete address of the images (with the server's address/domain name)
  • Or you just add it to the response in the frontend

Both should make the returned locations absolute (with the server's address/domain name on it). Thus, the images locations should look like this:

{"imgSrc":"https://myServer.com/rimg/source/cars/v/1.jpg?crop=false&width=55&height=92&fallback=default3.png&_v=45788f99e6dcc"}
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