Side navigation
#15131 closed bug (wontfix)
Opened June 03, 2014 05:50PM UTC
Closed June 09, 2014 04:18PM UTC
responseXXX not populated if status is not success
Reported by: | octplane | Owned by: | |
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 1.11.1 |
Keywords: | Cc: | octplane | |
Blocked by: | Blocking: |
Description
As per https://github.com/jquery/jquery/blame/d41e81980ea89e56c04eb14d8c27f4692b367604/src/ajax.js#L221
It seems that the dataType converters are not called when isSuccess is false
isSuccess = status >= 200 && status < 300 || status === 304;
This means that it's not possible to rely on jQuery dataType automatic decoding if it's not a success response.
Is there a reason why is this so ? Our "REST" implementation uses HTTP status code to convey the global success/failure of the request, and we also use a payload to describe precisely the status when possible.
Attachments (0)
Change History (3)
Changed June 03, 2014 05:52PM UTC by comment:1
cc: | → octplane |
---|
Changed June 03, 2014 05:54PM UTC by comment:2
reporter: | dmethvin → octplane |
---|
Changed June 09, 2014 04:18PM UTC by comment:3
resolution: | → wontfix |
---|---|
status: | new → closed |
We're planning a new $.xhr API that would be better suited for something like this. You can still deal with this via $.ajax if you do the conversions yourself, and we don't want to risk compatibility issues.
This was originally reportd by octplane and accidentally deleted.