I am trying to load an image from a URL. Some images work, but sometimes the response is a 403 error message. When I try to open the URL’s in my browser they work fine, but not through the processing code.
One of the images that does not load is this one: https://spoonacular.com/recipeImages/660290-556x370.jpg
I looked into the http.request library, but I cannot find a way to open images with that.
how can I solve this problem?
This happens a lot when js or different styles are used on that specific website.
A workaround is to publish it on Pinterest, and then right-click the image and copy the image link.
Just as a test I have done that with your image.
Thank you for you anwser @noel!
The link is provided by the Spoonacular Food API, and I need to open many of them through the code. So publishing every image on Pinterest is not really an option.
Do you know how I could solve this issue through code? Is there a way to send the appropriate header for example with the request?