3
我已將以下請求從郵遞員到的node.js:如何讀取內容類型:在node.js的應用/八位字節流請求
curl -X PUT -H "Content-Type: application/octet-stream" -H "app_key: dhdw-sdsjdbsd-dsdv-ddd" -H "Authorization: Login jddjd-ddd-ddd-ddd-ddd" -H "Cache-Control: no-cache" -H "Postman-Token: dbee5942-5d54-c1b7-415c-7ddf9cb88cd0" -d 'Code,Name,Parent,Address
root,root,,root
root1,root1,root,root1
root2,root2,root1,root2
root3,root3,root2,root3
root4,root4,root,root4
root5,root5,root4,root5
root6,root6,root,root6
' http://localhost:9000/api/locations/import
如何可以處理來自節點上述請求.js並讀取請求數據?
上述要求打我的路由器:
app.put('api/locations/import', function(req,res){
'use strict';
console.log(req.body);
console.log(req.body.hello);
res.send(200);
});
我總是讓req.body
是{}
。但我期待:
root,root,,root root1,root1,root,root1 root2,root2,root1,root2 root3,root3,root2,root3 root4,root4,root,root4 root5,root5,root4,root5 root6,root6,root,root6
你能詳細點嗎? – majidarif 2014-10-31 11:15:03