Laurent Perez wrote:
Hi
I'm familiar with httpclient v3, but not with v4. The new interceptors
are interesting, but I'm wondering if I should use them, given my
following use case.
I need to be able to check various response headers, for example
status code, and treat them as exceptions.
Previously, I wrote my own response checking stuff, but I'm wondering
if I could move some of this into a HttpResponseInterceptor, given its
process signature can throw HttpException.
Is it considered a good practice to move "response checking" scenarios
directly into the newly available interceptors, or should I just
abort() the method itself, as I used to do previously ? As far as I
understand it, it looks like response interceptors are good candidates
for transparent response wrapping, but I'm wondering if they were also
intended as "triggers" for response handling cases.
Thanks for your insight :)
laurent
Laurent,
Usually one may want to use interceptors in order to implement some
common processing that applies to all incoming / outgoing message
without cluttering the application specific logic with handling of
cross-cutting aspects.
The idea of moving message validation code to a protocol interceptor / a
set of interceptors seems reasonable to me.
Hope this helps
Oleg
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]