Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added .setResponseType handling #24

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Added .setResponseType handling #24

wants to merge 3 commits into from

Conversation

juskrey
Copy link

@juskrey juskrey commented Sep 16, 2014

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
Copy link

teropa commented Mar 29, 2015

+1

@danskarda
Copy link

Any chance this pull request gets merged? Thank you.

@r0man
Copy link
Owner

r0man commented Jun 3, 2015

@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
Copy link
Author

juskrey commented Jun 3, 2015

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

@edbond
Copy link

edbond commented Jul 29, 2015

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