如何避免POST请求响应未知事件代码

时间:2016-11-10 23:48:58

标签: javascript node.js http-post

我正在运行nodejs服务器,而我的客户端向服务器发出POST请求。但是在POST响应中,我得到了这些“未知事件72”等,如下面的wireshark屏幕截图所示。这些不必要的数据会增加应用程 这就是我处理响应的方式。感谢任何提示,以避免这些回复与POST响应。

/public

Screenshot of wireshark

1 个答案:

答案 0 :(得分:0)

试试这个:

res.writeHead(200, {'Content-Type': 'application/json'})
res.end(JSON.stringify(data));
相关问题