我在使用 XDomainRequestonerror
处理程序时遇到问题。发生错误时,我似乎无法获取 HTTP 响应的正文(通过xdr.responseText
)。成功的请求(200 OK)工作正常。
这是请求:
POST http://localhost/path HTTP/1.1
Accept: */*
Origin: http://localhost
Accept-Language: cs-CZ
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
Host: localhost
Content-Length: 34
Connection: Keep-Alive
Pragma: no-cache
[Data]
这是回应:
HTTP/1.1 400 Bad Request
Content-Length: 54
Content-Type: application/json; charset=utf-8
Server: Microsoft-IIS/7.5
Access-Control-Allow-Origin: *
Date: Mon, 30 Apr 2012 20:57:32 GMT
[Data]
是否可以获得响应体?