Suppose I need to call an RPC HTTP api that requires the client to HTTP POST (potentially with a file) a uri and on success results in a “Content-Type: image/png” binary. Is there any way I can do this within html/js and insert the png into the HTML document? Or will I need to provide a proxy service that supports HTTP GET?
Share
There is an answer here that looks like it will help you. I did not know this solution myself, but did some research for you:
http://blog.calyptus.eu/tags/binary-javascript/
IF you check out the source, you can see an example of how to display the base64 data that you get from the api response (the parameter being passed to show() here)
This might be a good starting point to experiment with. His example looks to be exactly what you’re trying to do