使用fetch将文件和正文发送到nodeJS

时间:2019-04-08 09:43:51

标签: javascript node.js reactjs fetch

如何将文件和其他人的请求发送到服务器(其余)? 到目前为止我尝试过的:

func = async(event)=> {
   const body = { city_id: 8 }
   const filesToServer = new FormData();
   Object.values(event.files).forEach(file => filesToServer.append(file.name, file));
   myreqFunction(path, [...filesToServer, body]);
}

0 个答案:

没有答案