Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

197
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!