【问题标题】:How to avoid POST request response Unknown event codes如何避免 POST 请求响应未知事件代码
【发布时间】:2016-11-10 23:48:57
【问题描述】:

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

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

Screenshot of wireshark

【问题讨论】:

  • I get these as in below screenshot of wireshark - 哪些是“这些”
  • @JaromandaXj 编辑了问题

标签: javascript node.js http-post


【解决方案1】:

试试这个:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-09-23
    • 1970-01-01
    • 2021-12-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多