HTTP 服务器如何通知其客户端响应已结束

发布于 2024-12-08 17:19:03 字数 271 浏览 1 评论 0原文

我知道, http客户端发送 0x10 0x13字节来通知http服务器请求数据已完成。

但是服务器如何通知http客户端响应数据已经完成呢? (它发送 -1 正确)?

I know that, the http clients sends 0x10 0x13 bytes to inform the http server that the request data has finished.

But how the server informs the http clients that the response data has finished? (it sends -1 i.e. <EOF> correct)?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

吲‖鸣 2024-12-15 17:19:03

不会。HTTP 客户端不会向服务器发送 CRLF 来指示请求已完成,服务器也不会向客户端发送特定的字节序列来指示完成。您应该阅读此文档: http://www.w3.org /Protocols/rfc2616/rfc2616-sec4.html#sec4.4 了解客户端和服务器如何确定请求或响应何时 完全的。简而言之,内容长度标头、分块传输编码终止符或 TCP/IP 连接关闭都用作信号。

No. HTTP Clients do not send CRLF to the server to indicate that the request is complete, and servers do not send a particular byte sequence to the client to indicate completion. You should read this document: http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.4 to understand how clients and servers are able to determine when a request or response is complete. The short summary is that the Content-Length header, Chunked Transfer-encoding terminator, or TCP/IP connection closure are all used as signals.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文