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.
This is because the images locations returned are relative. You have 2 possible solutions:
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"}