我正在我的项目中更新 httpclient 版本。httpclient 的当前版本是 httpclient3.2 我需要将它升级到 4.x(httpcomponents)。我可以通过这个url 进行很多更改。但是设置 httpstate 很困惑。在 httpclient 3.x 版本中,以下代码用于设置 http 版本
PoolingClientConnectionManager connMgr =new PoolingClientConnectionManager();
connMgr.setDefaultMaxPerRoute( m_maxConnectionsPerHost );
// Create a new HttpState container
HttpState initialState = new HttpState();
m_client = new DefaultHttpClient(connMgr);
m_client.setState( initialState );
什么是 HttpState 的等效 API,我可以使用它在 httpclient4.x(httpcomponents) 中设置 httpstate。我用谷歌搜索但没有清除。提前感谢您的帮助。