[英]React native TypeError: Network request failed with fetch()
[英]Adnroid : TypeError: Network request failed] - react native
我有以下代码:
const formdata = new FormData();
formdata.append("image", {
uri: this.state.photoUri,
type: 'image/jpeg',
name: 'imageddd.jpeg',
});
await fetch('https://mysite/upload.php',{
method: 'post',
headers: {
'Content-Type': 'multipart/form-data',
"Accept" : "application/json"
},
body: formdata
}).then(response => {
console.log('response: ' + JSON.stringify(response));
}).catch(err => {
console.log(err);
});
}
但我遇到的问题
[TypeError:网络请求失败]
在控制台中
我确定该错误与 header 有关,请尝试删除 header 一次,我的意思是尝试发送 header ZA8ZCFDE6331C4BEB2669666331C4BEB26 empty
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.