Opened 8 years ago

Closed 4 years ago

#15377 closed defect (patchwelcome)

dojo/request, nodejs and handleAs "xml" not working

Reported by: Kitson Kelly Owned by: Bryan Forbes
Priority: undecided Milestone: 1.11
Component: IO Version: 1.7.2
Keywords: Cc:
Blocked By: Blocking:

Description

It appears that dojo/request + node + handleAs "xml" is not working.

I have attached a example file, that if you run under node, returns the data as a string, instead of a parsed XML document:

node lib/dojo/dojo.js load=test

The example test is the following:

require(["dojo/request", "dojo/json"], function(request, JSON){
  request.get("http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=kitsonk&api_key=b25b959554ed76058ac220b7b2e0a026", {
    handleAs: "xml"
  }).then(function(response){
    console.log(JSON.stringify(response.data));
  }, function(err){
    console.log(err);
  });
});

Attachments (1)

test.js (339 bytes) - added by Kitson Kelly 8 years ago.
Example Test

Download all attachments as: .zip

Change History (3)

Changed 8 years ago by Kitson Kelly

Attachment: test.js added

Example Test

comment:1 Changed 7 years ago by Mark Wubben

Given that Node does not ship with an XML parser I'm not sure this should or even could be fixed. Instead can we throw an exception when handleAs: "xml" is used?

comment:2 Changed 4 years ago by dylan

Milestone: tbd1.11
Resolution: patchwelcome
Status: newclosed

We would accept a patch, but otherwise this won't get fixed as it's a minor issue.

Note: See TracTickets for help on using tickets.