I just announced the new Spring 5 modules in REST With Spring:
This is a comprehensive guide to using Apache HttpClient 4 – from starting out to advanced configuration and best practices.
1. HttpClient Basics
Learn the basics of sending a Request, receiving and interpreting the Response and configure the Client for basic usage.
-
Get the Status Code of a Request
-
Configure Timeout
-
Cancel/Abort a Request
-
Do Not Follow Redirects
-
Set Custom Header
-
HttpClient 4 Cookbook
-
Posting with HttpClient
2. Advanced Usage
Go into more advanced usecases of configuring the client with SSL, Custom Cookies, different types of Requests, etc.
-
HttpClient with SSL
-
Unshorten URLs with HttpClient
-
Send a Custom Cookie
-
Follow Redirects for POST Requests
-
HttpClient Basic Authentication
-
Multipart Upload
-
HttpAsyncClient Tutorial
-
HttpClient Connection Management
The implementation of all these examples and code snippets can be found in my github project – this is an Eclipse based project, so it should be easy to import and run as it is.
Would you still suggest using HttpClient 4 over Spring’s RestTemplate or Feign? If so, could you elaborate why?
Thanks for the reply. Always appreciate when blog authors actually reply 🙂
Can you briefly name a few things that HttpClient gives you more control of than RestTemplate? (I’m curious because I usually use RestTemplate)
I see! Thanks for the insightful reply!
Hi, do you an article about configuring logging for Apache HC?
No, we did not. Thanks for the suggestion, I will add this idea to our “content calendar”.