cljs-http
cljs-http copied to clipboard
Added .setResponseType handling
Suitable for e.g. arraybuffers requests. Takes standard values, as in goog.net.XhrIo.ResponseType Example:
(http/get "http://example.com/some-binary-api"
{:with-credentials? false
:response-type "arraybuffer"})
Defaults to ""
In the returned map, adds :response-type key, which returns (.getResponseType target) for response consistency checking and :response, which returns (.getResponse target), the proper way of handling non-default request types.
+1
Any chance this pull request gets merged? Thank you.
@danskarda I agree that we should return the response under the :body key in this case as well. Updated patch with tests welcome!
Also, is this only working in Webkit?
http://closure-library.googlecode.com/git-history/docs/class_goog_net_XhrIo.html
I'll look into it, considering the new updates (plus the comment about optional :body).
Definitely should be added, I'm downloading torrent files and need a binary option. Have to switch to cljs-ajax for now.