Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/react-native/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
React native React native我使用fetch-to-post-image获取网络请求失败_React Native_Server_Fetch_Blob_Image Upload - Fatal编程技术网

React native React native我使用fetch-to-post-image获取网络请求失败

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

我正在尝试向服务器发送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",
    //"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
 })

是的,它显示错误有解决错误的方法吗