You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Marko Asplund <ma...@gmail.com> on 2013/06/01 14:37:13 UTC

Intercepting and responding to requests on client-side

Hi,

I'd like to be able to intercept requests targeted for certain
endpoints issued by HttpClient and implement a custom handler for
those requests. The handler should be able to generate a response for
the requests on the client-side without actually connecting to a
remote server.

Is this possible with HttpClient?
I've looked at HttpRequestInterceptor and HttpResponseInterceptor
APIs, but these interceptors don't seem to be able to generate the
actual response.

marko

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Re: Intercepting and responding to requests on client-side

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Sat, 2013-06-01 at 15:37 +0300, Marko Asplund wrote:
> Hi,
> 
> I'd like to be able to intercept requests targeted for certain
> endpoints issued by HttpClient and implement a custom handler for
> those requests. The handler should be able to generate a response for
> the requests on the client-side without actually connecting to a
> remote server.
> 
> Is this possible with HttpClient?
> I've looked at HttpRequestInterceptor and HttpResponseInterceptor
> APIs, but these interceptors don't seem to be able to generate the
> actual response.
> 
> marko
> 

Marco,

Please upgrade to 4.3 and have a look at the new execution chain APIs.
You can use the caching exec as an example of how HttpClient can be made
to respond with a response without hitting the target server.

Oleg



---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org