HTTP Server如何通知其客户端响应已结束 [英] How HTTP Server inform its clients that the response has ended
问题描述
我知道, http客户端发送 0x10
0x13
字节以通知http服务器请求数据已完成。
I know that, the http clients sends 0x10
0x13
bytes to inform the http server that the request data has finished.
但服务器如何通知http客户端响应数据已完成? (它发送 -1
即< EOF>
正确)?
But how the server informs the http clients that the response data has finished? (it sends -1
i.e. <EOF>
correct)?
推荐答案
不。 HTTP客户端不会向服务器发送CRLF以指示请求已完成,并且服务器不会向客户端发送特定的字节序列以指示完成。您应该阅读本文档: http://www.w3.org /Protocols/rfc2616/rfc2616-sec4.html#sec4.4 了解客户端和服务器如何确定请求或响应何时完成。简短的总结是Content-Length头,Chunked Transfer-encoding终结符或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.
这篇关于HTTP Server如何通知其客户端响应已结束的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!