Skip to content

Added .setResponseType handling#24

Open
juskrey wants to merge 3 commits into
r0man:masterfrom
juskrey:master
Open

Added .setResponseType handling#24
juskrey wants to merge 3 commits into
r0man:masterfrom
juskrey:master

Conversation

@juskrey

@juskrey juskrey commented Sep 16, 2014

Copy link
Copy Markdown

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.

@teropa

teropa commented Mar 29, 2015

Copy link
Copy Markdown

+1

@danskarda

Copy link
Copy Markdown

Any chance this pull request gets merged? Thank you.

@r0man

r0man commented Jun 3, 2015

Copy link
Copy Markdown
Owner

@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

@juskrey

juskrey commented Jun 3, 2015

Copy link
Copy Markdown
Author

I'll look into it, considering the new updates (plus the comment about optional :body).

@edbond

edbond commented Jul 29, 2015

Copy link
Copy Markdown

Definitely should be added, I'm downloading torrent files and need a binary option. Have to switch to cljs-ajax for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants