Opened 8 years ago
Closed 7 years ago
#16893 closed enhancement (fixed)
[patch][ccla] Setting responseType in dojo/request/xhr
Reported by: | Marten Lienen | Owned by: | dylan |
---|---|---|---|
Priority: | high | Milestone: | 1.10 |
Component: | IO | Version: | 1.8.3 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
You should be able to use other response types than text, when using dojo/request/xhr. This is needed when you want to request binary data like images.
Change History (8)
comment:1 Changed 8 years ago by
Component: | General → Core |
---|---|
Owner: | set to Marten Lienen |
Status: | new → pending |
comment:2 Changed 8 years ago by
Status: | pending → new |
---|
No, I needed to set the responseType attribute to "arraybuffer" directly on the XHR object. My current solution/hack is to:
- listen on the "send" event and set the responseType on the xhr object, that I extract from the response event attribute
- switch out the handleResponse function for one that does not read responseText (DOMException when responsetype is not text) and instead reads the response attribute
- Change it all back so that later requests are not influenced
But that does not seem the right thing to do ;)
comment:3 Changed 8 years ago by
Owner: | changed from Marten Lienen to Bryan Forbes |
---|---|
Status: | new → assigned |
comment:5 Changed 7 years ago by
Component: | Core → IO |
---|---|
Milestone: | tbd → 1.10 |
Priority: | undecided → high |
Summary: | Setting responseType in dojo/request/xhr → [patch][ccla] Setting responseType in dojo/request/xhr |
comment:6 Changed 7 years ago by
Owner: | changed from Bryan Forbes to dylan |
---|
I will try to add the missing test to this PR this week if possible.
comment:8 Changed 7 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Note: See
TracTickets for help on using
tickets.
is http://dojotoolkit.org/reference-guide/1.8/dojo/request/handlers.html#dojo-request-handlers what you need?