我的代码:
const file = {
uri: this.state.imageSource,
name: this.state.imageName,
type: 'image/jpg',
};
const data = new FormData();
data.append('file', file);
fetch(config.server + '/upload', {
method: 'POST',
body: data,
})
.then((res) => res.json())
.then((responseData) => {
alert(JSON.stringify(responseData));
})
.catch((err) => {
alert(err);
});
如果没有FormData码,则不会显示错误.我该怎么做才能修复?在android上调试.