我正在使用以下代码发出请求:
Request {
url: 'http://localhost:10002/asset/upload'
method: 'POST'
formData:
filename: fileName
code: imageCode
type: 'raw'
event_id: eventId
file: fs.createReadStream(filePath)
slug: "testing-the-stuff"
在我的快速应用程序中,我有一条这样的路线:
app.post "/asset/upload", (req, res, next) ->
assetController.upload req, res, next
还有一个看起来像这样的控制器:
exports.upload = (req, res, next) ->
console.log req.body
res.json 'upload'
一切正常,没有失败,但身体总是空的?我不确定是否有其他访问方式"formData"
作为参考,我正在使用bodyparser