English 中文(简体)
XDomainRequest - Get response body on mis
原标题:XDomainRequest - Get response body on error

I m 涉及XDomainRequestonerror。 当出现错误时,我似乎无法得到吉大港定居地保有权的反应(通过<条码>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]

能否获得回复机构?

问题回答

不幸的是,不可能使答复机构出现错误。 大家都知道,发生了错误。 See my related question here: 是否可能把CORS的错误陷阱?

一种可能的工作方向(如果你控制服务器),是总是将《吉大港山区规则》退回200,但将错误代码列入答复机构。





相关问题
How to fix CORS for Capacitor/Quasar App in a Laravel API

I have an App built on top of Quasar and Capacitor, with an API built on top of Laravel. Everything works well on the dev environment until I build and install the app on my phone, then I keep getting ...

Laravel +Vuejs CORS issue

I am facing a dilemma wit the CORS issue. I have application that is configured as follow: API: https://abc.mydomain.com (laravel) front end: https://subdomain.mydomain.com(VueJS) Both applications ...

Why does CORS not seem to work with POST?

Mozilla s own specification says simple GET or POST should be natively CORS s without preflighting but so far every POST attempt I ve made has resulted in an OPTIONS header going out. When I change ...

热门标签