Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

For some problem that we couldn't solve, I want to disable keep alive on Apache HttpClient 3.1. However, I couldn't find any resource on the Internet for that. Do you know how to do it?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
703 views
Welcome To Ask or Share your Answers For Others

1 Answer

You can disable HTTP 1.1 support on you method, i.e. httpMethod.setHttp11(false); but you will lost some other features.

You can also try to force the connection header to ask the server to close the connection after its response: httpMethod.setRequestHeader("Connection", "close").


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...