Opened 8 years ago

Last modified 4 years ago

#18057 assigned defect

xhr.del (dojo/request/xhr) doesn't automatically handle json response

Reported by: xgendrea Owned by: dylan
Priority: undecided Milestone: 1.14
Component: IO Version: 1.9.3
Keywords: Cc:
Blocked By: Blocking:


Hi all,

When I use this code for example:

    handleAs : "json",
    headers : {
      "Accept": "application/javascript, application/json"
  function (data) {
    var rowId = json.parse(data)[0].id; // why json.parse is needed !!!! 

I need to use json.parse because data is a string.

This is different as in xhr.get or xhr.put because response data in those cases are automatically parsed.

For my point of view, as handleAs is set to 'json', the automatic parsing functionnality must be made in xhr.del.

Thx for your answer

Change History (3)

comment:1 Changed 6 years ago by dylan

Milestone: tbd1.8.11
Owner: set to dylan
Status: newassigned

The reason this is not supported is that delete was not expected to have a payload for you to handle/parse. That said, the spec says otherwise, .

Will look at this for 1.12.

comment:2 Changed 6 years ago by dylan


comment:3 Changed 4 years ago by dylan

Milestone: 1.131.14
Note: See TracTickets for help on using tickets.