Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Won't Fix
-
4.2.2
-
None
Description
If the developer gets a HttpClient thats extends AbstractHttpClient, he will be able to add interceptor and call all the public get or set method of this class.
If the HttpClient is a decorator it's not possible to do all of this. The reason is that you cannot get the embedded HttpClient from a decorator client.
What would be nice, is to have an interface DecoratorClient with the method getEmbeddedHttpClient()
This interface would be implemented by AutoRetryHttpClient, DecompressingHttpClient and CachingHttpClient.
This way whenever you chain HttpClient you could still benefit from the methods of AbstractHttpClient/DefaultHttpClient.
Another possbility would be to have a getBaseHttpClient() and to have it implemented with return this in AbstractHttpClient.