我找到了解决方案:
let body = new FormData();body.append('photo', {uri: imagePath,name: 'photo.png',filename :'imageName.png',type: 'image/png'}); body.append('Content-Type', 'image/png');fetch(Url,{ method: 'POST',headers:{ "Content-Type": "multipart/form-data", "otherHeader": "foo", } , body :body} ) .then((res) => checkStatus(res)) .then((res) => res.json()) .then((res) => { console.log("response" +JSON.stringify(res)); }) .catch((e) => console.log(e)) .done()**文件名是可选的…



