Reputation: 693
I would like to return content-type image from AWS API Gateway without the use of a lambda. e.g. so I can reference in on a page.
The returning type needs to be an image content type with no image.
I see that AWS have now implemented binary support but I have been unable to do the above.
Upvotes: 0
Views: 593
Reputation: 693
I managed to work this one out.
You might be able to do have less steps but this is what I ended up with.
Calling the API returns a valid 204 no content response for content-type image/png.
If you render this pixel by using javascript you avoid an img tag being required in the dom and you dont get a browser missing image placeholder.
e.g.
<script type="text/javascript"> (new Image()).src = "{url}"; </script>
Upvotes: 1