React native React native我使用fetch-to-post-image获取网络请求失败
我正在尝试向服务器发送blob映像,但react native显示错误network failed错误React native React native我使用fetch-to-post-image获取网络请求失败,react-native,server,fetch,blob,image-upload,React Native,Server,Fetch,Blob,Image Upload,我正在尝试向服务器发送blob映像,但react native显示错误network failed错误 get_data = async () => { let file = new FormData(); fetch("https://jzzqf.sse.codesandbox.io/", { method: "POST", headers: { "Content-Type": "multipart/form-data; charset=utf-8", //"C
get_data = async () => {
let file = new FormData();
fetch("https://jzzqf.sse.codesandbox.io/", {
method: "POST",
headers: {
"Content-Type": "multipart/form-data; charset=utf-8",
//"Content-Type": "text/html; charset=utf-8",
"Access-Control-Allow-Origin": "*"
},
mode: "no-cors",
body: file
})
.then(function(response) {
alert(response);
})
.catch(function(error) {
alert(error);
});
}) 然后切换您的密码以处理拒绝承诺
.then(response =>
{
alert(response);
}, reject => {
// handle reject here
})
是的,它显示错误有解决错误的方法吗