【问题标题】:How to solve the error CORS ? mode: 'no-cors'如何解决错误CORS?模式:'无cors'
【发布时间】:2021-05-28 07:31:43
【问题描述】:
const result = await fetch(https://example.com', {
  method: 'POST',
  mode: 'no-cors',
  headers: {
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"username": "Jochan","countFollowers": 60001}),
});

我正在尝试向第三方 API 发送请求,出现错误,我该如何解决? 错误: POST https://example.com net::ERR_ABORTED 500(内部服务器错误)

【问题讨论】:

标签: node.js api fetch nuxt.js


【解决方案1】:

您无权从未设置适当标头的 API 获取响应。如果它既不是您的 API 也不是公共 API,您只能尝试使用谷歌搜索中的 CORS 代理进行一些黑客攻击

【讨论】:

    猜你喜欢
    • 2023-01-06
    • 2021-09-15
    • 2020-02-22
    • 2021-09-27
    • 2021-07-14
    • 2022-09-14
    • 1970-01-01
    • 2023-03-12
    • 2016-07-06
    相关资源
    最近更新 更多