2、HttpClient修改处理策略Strategy
HttpClient提供了很多接口,让我们能自定义处理逻辑,这些接口可以在AbstractHttpClient中找到:
setAuthSchemes(AuthSchemeRegistry);
setConnectionBackoffStrategy(ConnectionBackoffStrategy);
setReuseStrategy(ConnectionReuseStrategy);
setKeepAliveStrategy(ConnectionKeepAliveStrategy);
setHttpRequestRetryHandler(HttpRequestRetryHandler);
setRedirectHandler(RedirectHandler);
setRedirectStrategy(RedirectStrategy);
setTargetAuthenticationHandler(AuthenticationHandler);
setTargetAuthenticationStrategy(AuthenticationStrategy);
setProxyAuthenticationHandler(AuthenticationHandler);
setProxyAuthenticationStrategy(AuthenticationStrategy);
setUserTokenHandler(UserTokenHandler);
posted on 2013-08-04 15:13 angelshelter 阅读(1596) 评论(0) 编辑 收藏 举报
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步