流星如何使用邮递员的体形数据上传图像?

时间:2019-07-17 14:06:44

标签: meteor postman

我正在为移动应用创建API,需要创建API来上传用户个人资料图片。    但是,当我尝试在发布请求中获取上传的图片时,显示的是空的请求。这是我的代码。

 Router.route('/api/uploadimage/', { where: 'server' })
   .post(function () {

     let response;
     console.log(this.request.body.files);

     this.response.setHeader('Content-Type', 'multipart/form-data');
     this.response.end(JSON.stringify(response));

  });

0 个答案:

没有答案