0
我正在使用此代碼的請求:如何通過節點訪問此請求中的formData?
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"
在我的Express應用程序我有一個路線,像這樣:
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