简体   繁体   English

CORS:对预检请求的响应未通过访问控制检查:它没有 HTTP 正常状态。 REACTJS, AXIOS

[英]CORS: Response to preflight request doesn't pass access control check: It does not have HTTP ok status. REACTJS, AXIOS

Excuse my writing, use a translator for this.请原谅我的写作,为此请使用翻译器。

I am trying to consume an api which in the headers only receives the access token, but I get this response in the console.我正在尝试使用一个 api,它在标头中只接收访问令牌,但我在控制台中得到了这个响应。 I am using Axios with React.我在 React 中使用 Axios。

Access to XMLHttpRequest at '<apiURL>' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status.

Here is an image of the error.这是错误的图像。

Error错误

I already tried to send the header parameters, but nothing has worked so far.我已经尝试发送 header 参数,但到目前为止没有任何效果。

Allow the localhost origin in the cors config of the backend if possible or use the extension to disable the cors from the browser.如果可能,在后端的 cors 配置中允许本地主机来源,或者使用扩展从浏览器中禁用 cors。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 MVC Azure + AjaxCall + microsofttranslator +对预检请求的响应未通过访问控制检查:它没有HTTP ok状态 - MVC Azure + AjaxCall + microsofttranslator + Response to preflight request doesn't pass access control check: It does not have HTTP ok status 预检请求未通过访问控制检查:它没有 HTTP ok 状态 - Preflight request doesn't pass access control check: It does not have HTTP ok status CORS-对预检请求的响应未通过访问控制检查 - CORS - Response to preflight request doesn't pass access control check ReactJS:已被CORS策略阻止:对预检请求的响应未通过访问控制检查 - ReactJS: has been blocked by CORS policy: Response to preflight request doesn't pass access control check “http://localhost:3000”已被 CORS 策略阻止:对预检请求的响应未通过访问控制检查: - 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: Angular POST 请求被 CORS 策略阻止:对预检请求的响应未通过访问控制检查 - Angular POST request been blocked by CORS policy: Response to preflight request doesn't pass access control check 被 CORS 策略阻止:对预检请求的响应未通过访问控制检查 - blocked by CORS policy: Response to preflight request doesn't pass access control check Next.js 和 Express 的 CORS 问题:对预检请求的响应未通过访问控制检查: - CORS issue with Next.js and Express: Response to preflight request doesn't pass access control check: CORS:对预检请求的响应未通过访问控制检查 - 如何在本地主机上解决? - CORS: response to preflight request doesn't pass access control check - How to solve it on localhost? CORS:添加 header 时对预检请求的响应未通过访问控制检查 - CORS: Response to preflight request doesn't pass access control check when add header
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM