0
我在Chrome和我看到這個奇怪的錯誤:提取API收益「類型錯誤:無法取得」
TypeError: failed to fetch
(是的,這是整個錯誤消息)。
這裏是產生錯誤的代碼:
fetch(logoUrl, {
method: 'put',
headers: {
'Content-Type': 'image/jpeg',
//encode credentials as base64
'Authorization': 'Basic ' + btoa('cdt-deployer:xyz'),
},
body: imgFile // the file
}).catch(function(err){
// the error appears here
})
那我該怎麼辦?我不知道什麼是錯的。我只是試圖發送一個二進制映像文件到另一臺服務器(我看不到服務器日誌)。
請發佈完整的錯誤。 – emil
如果您嘗試使用其他瀏覽器,您是否會遇到同樣的錯誤?你是否已經使用curl或Postman等其他客戶端成功完成了PUT? – sideshowbarker
@emil是完全錯誤的傢伙。我在這個問題中說過。 –