Reputation: 6249
We have a Web API (MVC4) application that returns images from the database. I have verified that the call to the Web API does produce a valid image.
Here is the Fiddler result showing that the image is returned properly: :
I tried setting an image element with the same source as the call, but that didn't work:
<img id="img" src="http://localhost/Seek/api/artifactcontent/?userName=XXXXX&password=XXXXXX&id=15-00931-27" />
What am I doing wrong?
Upvotes: 0
Views: 1095
Reputation: 87228
You request in Fiddler is a POST request; the <img>
tag sends a GET request. If you want to display images using <img>
tags, you'll need to make your action accept GET requests instead of (or in addition to) POST.
Upvotes: 2