簡體   English   中英

如何解決錯誤 CORS? 模式:'無cors'

[英]How to solve the error CORS ? mode: 'no-cors'

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(內部服務器錯誤) 在此處輸入圖像描述

您無權從未設置適當標頭的 API 獲得響應。 如果它既不是你的 API 也不是公共的,你只能嘗試使用谷歌搜索中的 CORS 代理進行一些黑客攻擊

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM