简体   繁体   English

使用apache httpcomponent 4.0.x,如何从客户端prgram发送不带标题“ Connection:Keep-Alive”的http请求?

[英]Using apache httpcomponent 4.0.x, how to send a http request without the header “Connection: Keep-Alive” from a client prgram?

I'm using apache httpcomponent 4.0.x. 我正在使用apache httpcomponent4.0.x。

How to send a http request without the header "Connection: Keep-Alive" from a client prgram? 如何从客户端prgram发送不带标题“ Connection:Keep-Alive”的http请求?

For some reason, the Connection header is always set to keep-alive no matter what the http version is set to. 由于某些原因,无论http版本设置为什么,Connection头始终设置为保持活动状态。 Version http 1.0. 版本http 1.0。 or 1.1 doesn't make any difference. 或1.1没有任何区别。

If you set the version to 1.0 and it still adds "Connection: Keep-Alive" you should report it as bug at the project's bug tracker . 如果将版本设置为1.0,但仍添加“ Connection:Keep-Alive”,则应在项目的错误跟踪器处将其报告为错误。 HTTP 1.0 does not support persistent connections so the header should not be added. HTTP 1.0不支持持久连接,因此不应添加标头。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM