cljs-http
cljs-http copied to clipboard
Binary response data gets mangled
When I do a GET of, e.g., a JPEG, it seems that the :body
of the response gets mangled when it is converted to a string. How do I get access to the raw binary of the response body?
To get a raw binary body, add :response-type :array-buffer
to the request options. Alternative keywords include:
:array-buffer XhrIo.ResponseType.ARRAY_BUFFER :blob XhrIo.ResponseType.BLOB :document XhrIo.ResponseType.DOCUMENT :text XhrIo.ResponseType.TEXT :default XhrIo.ResponseType.DEFAULT
Added How to Fetch Binary Data to the wiki.