SDWebImage / SDWebImageSwiftUI

SwiftUI Image loading and Animation framework powered by SDWebImage
https://sdwebimage.github.io/SDWebImageSwiftUI
MIT License
2.14k stars 219 forks source link

Failed to download image with error Download marked as failed because response status code is not in 200-400 #209

Closed RajaZahid closed 2 years ago

RajaZahid commented 2 years ago

Try to display image but getting error: Failed to download image with error Download marked as failed because response status code is not in 200-400

Try following image URL: http://admin-qa.fetchmyorder.com/uploads/Sample3.jpg

Image URL is valid and able to see image in browser.

RajaZahid commented 2 years ago

Although it is loading fine with 2nd attempt.

vebbis321 commented 2 years ago

I have the exact same problem. When I open the SettingsView in my project, the URL is there and it is valid, but the image doesn't show up.

Simulator Screen Shot - iPhone 13 Pro Max - 2022-01-20 at 11 56 30

But then I select one of the settings and go back (no new callbacks or new network calls done), and now the image is showing.

Simulator Screen Shot - iPhone 13 Pro Max - 2022-01-20 at 11 56 45 Simulator Screen Shot - iPhone 13 Pro Max - 2022-01-20 at 11 57 55

I also ran the exact same code with AsyncImage without any errors.

dreampiggy commented 2 years ago

Use API : https://sdwebimage.github.io/SDWebImage/Classes/SDWebImageDownloaderConfig.html#/c:objc(cs)SDWebImageDownloaderConfig(py)acceptableStatusCodes

to change the "valid HTTP status code", which is defaults to [200, 400)

UI10 commented 2 years ago

acceptableStatusCodes is not available inSDWebImageDownloaderConfig.h file on SDWebImage 5.10.4