-
Notifications
You must be signed in to change notification settings - Fork 38.5k
Upgrade Apache HttpClient to version 4.0 [SPR-6180] #10848
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Oleg Kalnichevski commented RestTemplateIntegration tests pass for me when using HttpClient 4.0 based implementation of the HTTP request factory. |
Sylvain LAURENT commented Any update on this ? |
Oleg Kalnichevski commented Arjen, HttpClient 4.1 GA will be released within a week or two. Please consider upgrading to 4.1 bypassing 4.0. Oleg |
Roy Clarkson commented I've implemented Oleg's patch in Spring-Android-Rest-Template as HttpComponentsClientHttpRequestFactory, since Android has no support for the Commons 3.x client. ANDROID-7. |
John Eckhart commented I understand adding 4.0 (or even better 4.1), but is there really a need to remove the 3.x support? This will require any project that has implemented HttpClient 3.x and CommonsClientHttpRequestFactory in their app to upgrade the entire HttpClient stack in order to upgrade from Spring 3.0.x to Spring 3.1. I believe that HttpClient 4.x occupies a separate package namespace (and maven group/artifact id) from HttpClient 3.x and the Spring factories for each have separate names. Perhaps it would be better to |
Arjen Poutsma commented
|
Arjen Poutsma commented This has been committed. Oleg, thanks for the help! Could you please check SVN to see if everything is OK? |
Oleg Kalnichevski commented Looks good to me. I wish there was a way to avoid having to buffer request content in memory, though. Oleg |
David Parks commented Not sure if I should comment here or open a new request, but I'll note here first: Any use cases which require an HttpContext attribute to be set aren't covered in this implementation, and the extensions required make the whole thing so messy as to make using the Rest Template more of a burden than a benefit. Here is the particular case that I've been fussing with today to little avail, setting preemptive authentication (i.e. send basic authentication headers by default rather than performing 2 requests to authenticate): http://hc.apache.org/httpcomponents-client-ga/tutorial/html/authentication.html#d4e1023 The problem being that the RestTemplate implementation as it is has no support for setting HttpContext parameters (the template calls the Http.execute(HttpUriRequest) which uses only the non-accessible default HttpContext), there aren't any good way to set the default context parameters on the HttpClient in 4.x Apache HTTP Components. You end up needing to extend HttpClient to provide for default HttpContext params on the HttpClient object and the whole thing just becomes a spaghetti mess from there making the template more pain than pleasure. |
Arjen Poutsma commented
That's certainly something we can try to improve. Can you please create a new JIRA for this issue, and comment the issue number here so that I can follow up on it? |
David Parks commented |
Arjen Poutsma commented
There now is, see #15356. |
Oleg Kalnichevski opened SPR-6180 and commented
Folks,
Please consider upgrading HttpClient to version 4.0 which is the latest stable (GA) version of the library. Commons HttpClient 3.1 is very likely to be deprecated / officially declared end of life very soon (3 - 6 months). There have been no bug fixes in the 3.x branch for over a year.
Patch attached. Unfortunately I was unable to fix the Ivy build which I am not very familiar with.
Oleg
Affects: 3.0 RC1
Attachments:
Issue Links:
Referenced from: commits 3690002, 54bbcf3
17 votes, 20 watchers
The text was updated successfully, but these errors were encountered: