English 中文(简体)
HTTP: 在发出请求后,停用书面材料?
原标题:HTTP: shutdown socket for writing after sending the request?
  • 时间:2012-01-13 19:04:43
  •  标签:
  • http
  • sockets

在收到请求后,如何妥善关闭吉大港定居地安置点的客户使用的袖珍材料? 或者,在收到完整答复之前,它是否必须保持开放(间接)? 如果是的话,由服务器确定的申请机构的结束如何?

According to http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.4, closing the socket is not an option for a request. That doesn t sound logical to me - why should a half-closed TCP connection be a problem for the server, if the client doesn t try to transmit anything after closing its half of the socket? The client can still receive data after all.

在我看来,关闭单册的文字部分,是让服务器知道申请已经结束的非常实际的办法。 甚至具体提到这一使用案例。

如果这真是错了,那么什么是替代的? 我是否确实总是必须发出“集装箱”或使用舱面运输,使服务器能够适当找到请求的结束? 如何为那些体内未知的要求工作?

最佳回答

<代码>Transfer-Encoding:chunked专门用于接收请求和答复数据,提供体积不明的数据。 这些数据的结尾取决于能否获得有效载荷为0的chu。 如果您没有发出<条码>>> 空白的要求,那么你必须发出<条码>。

问题回答

Are you talking about this?:

Closing the connection cannot be used to indicate the end of a request body, since that would leave no possibility for the server to send back a response.

我认为,案文是完全接近的,你可以做一半(标准)。 我不敢肯定,吉大港山区综合开发方案的编纂方式是这样,但我认为大多数服务器将接受。

关于你的第二个问题,只是使用chu:

所有接收实体的《吉大港山区行动计划》/1.1项申请都接受“原始”转让编码(第3.6节),因此,如果电文长度不能事先确定,该机制就可用于电文。





相关问题
How to set response filename without forcing "save as" dialog

I am returning a stream in some response setting the appropriate content-type header. The behavior I m looking for is this: If the browser is able to render content of the given content type then it ...

Which Http redirects status code to use?

friendfeed.com uses 302. bit.ly uses 301. I had decided to use 303. Do they behave differently in terms of support by browsers ?

Does HttpWebRequest send 200 OK automatically?

Background: I am implementing Paypal IPN handler. This great article on Paypal states that I am required to send a 200 OK back to Paypal after I read the response. The processing of IPN request is ...

Java HTTPAUTH

我试图把桌面应用程序连接起来,我是同D.icio.us api @ Delicious Alan书写的,简单地向他们提供我的用户名和密码,并请他把书记上写给我......。

Finding out where curl was redirected

I m using curl to make php send an http request to some website somewhere and have set CURLOPT_FOLLOWLOCATION to 1 so that it follows redirects. How then, can I find out where it was eventually ...

热门标签