On Fri, 2008-06-20 at 11:50 -0700, Bob Lee wrote:
...
> Or even something like this:
>
> public interface ResponseHandler<T> {
> T handle(HttpResponse response) throws IOException;
> }
>
> String result = client.execute(myHandler);
>
> Then you could have a few reusable response handlers, like a JSON handler,
> and XML handler, etc.
>
> Bob
Folks,
I added support for response handlers as suggested by Bob. Here's the
example of the new API
http://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk/module-client/src/examples/org/apache/http/examples/client/ClientWithResponseHandler.java
http://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/BasicResponseHandler.java
I think it turned out pretty neat.
Bob, please review.
Oleg
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]