Opened 7 years ago

Closed 6 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 7 years ago by ben hockey

Component: GeneralCore
Owner: set to Marten Lienen
Status: newpending

comment:2 Changed 7 years ago by Marten Lienen

Status: pendingnew

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 7 years ago by ben hockey

Owner: changed from Marten Lienen to Bryan Forbes
Status: newassigned

comment:5 Changed 6 years ago by dylan

Component: CoreIO
Milestone: tbd1.10
Priority: undecidedhigh
Summary: Setting responseType in dojo/request/xhr[patch][ccla] Setting responseType in dojo/request/xhr

comment:6 Changed 6 years ago by dylan

Owner: changed from Bryan Forbes to dylan

I will try to add the missing test to this PR this week if possible.

comment:7 Changed 6 years ago by dylan

comment:8 Changed 6 years ago by dylans <dylan@…>

Resolution: fixed
Status: assignedclosed

In 8309d50f6ca00960a065ece830535bb58ef65bf6/dojo:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 
Note: See TracTickets for help on using tickets.