Disable Keep Alive in Apache HttpClient

前端 未结 1 1238
粉色の甜心
粉色の甜心 2020-12-20 21:59

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

相关标签:
1条回答
  • 2020-12-20 22:47

    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").

    0 讨论(0)
提交回复
热议问题