CORS 内容类型
CORS content-type
我正在研究与第三方网络服务器的接口。我基本上需要将 http 请求从我的网络应用程序发送到他们的服务器,这需要跨源支持。最初,服务器不支持 cors,所以当他们致力于添加 Cors 支持时,我使用 fiddler 修改响应。
这让我得以继续工作。现在,他们说他们支持 Cors,但仅限于简单的请求。选项(预检)仍然以 405 响应。
我的问题是,是否可以将所有 cors 请求强制为简单请求?感谢您能给我的任何帮助。
My question is, is it possible to force all cors requests to be simple requests?
只能通过消除最初使它们变得复杂的条件。参见 MDN。
A simple cross-site request is one that meets all the following
conditions:
The only allowed methods are:
- GET
- HEAD
- POST
Apart from the headers set automatically by the user agent (e.g.
Connection, User-Agent, etc.), the only headers which are allowed to
be manually set are:
- Accept
- Accept-Language
- Content-Language
- Content-Type
The only allowed values for the Content-Type header are:
- application/x-www-form-urlencoded
- multipart/form-data
- text/plain
我正在研究与第三方网络服务器的接口。我基本上需要将 http 请求从我的网络应用程序发送到他们的服务器,这需要跨源支持。最初,服务器不支持 cors,所以当他们致力于添加 Cors 支持时,我使用 fiddler 修改响应。
这让我得以继续工作。现在,他们说他们支持 Cors,但仅限于简单的请求。选项(预检)仍然以 405 响应。
我的问题是,是否可以将所有 cors 请求强制为简单请求?感谢您能给我的任何帮助。
My question is, is it possible to force all cors requests to be simple requests?
只能通过消除最初使它们变得复杂的条件。参见 MDN。
A simple cross-site request is one that meets all the following conditions:
The only allowed methods are:
- GET
- HEAD
- POST
Apart from the headers set automatically by the user agent (e.g. Connection, User-Agent, etc.), the only headers which are allowed to be manually set are:
- Accept
- Accept-Language
- Content-Language
- Content-Type
The only allowed values for the Content-Type header are:
- application/x-www-form-urlencoded
- multipart/form-data
- text/plain