hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xu, Lilu" <cooki...@gmail.com>
Subject Re: First few classes
Date Mon, 30 May 2011 11:16:34 GMT

here is two different ideas about this project in my mind now. One is
similar as Oleg said: creating some builders and utilities classes providing
an "simple and lightweight" way to use the methods in HttpClient. The other
is more closed to my current implementation: creating new classes with
fluent methods, meanwhile they also implement the interfaces defined in
HttpClient such that they are compatible with the existed classes in

BTW, the FluentRequest in my "first few classes" can also be treated as an
org.apache.http.HttpRequest. For example, you can use the DefaultHttpClient
to interact with FluentRequest or FluentResponse as follow.

FluentRequest request = request("http://www.apache.org/").by(GET_METHOD);
DefaultHttpClient client = new DefaultHttpClient();
HttpResponse response = client.execute(request);
// ...

Do you have any suggestions about these two ideas?


On Sat, May 28, 2011 at 7:03 PM, Oleg Kalnichevski <olegk@apache.org> wrote:

> On Fri, 2011-05-27 at 14:49 +0300, Lilu Xu wrote:
> > Hi all,
> >
> > the project of a fa├žade API of HttpClient with fluent style now is hosted
> on the Google Code [1]. Some few classes have been implemented. Source code
> and javadoc should be found on the project website. I also wrote a Wiki page
> of those classes [2]. Hopefully you could drop me some comments.
> >
> > Best,
> > Lilu
> >
> > [1] http://code.google.com/p/fluent-hc/
> > [2] http://code.google.com/p/fluent-hc/wiki/RequestExecution
> Lilu
> It is great you have been making progress.
> I do not want to impose any particular design onto you. However, as a
> potential user of the fluent API I would be happier if I could pick out
> just those classes from fluent-hc that simplify routine operations for
> me while continuing to use the 'native' HttpClient API where it suits
> me. In other words it would prefer to have request builders that return
> fully initialized HttpRequest instance which could be just passed to a
> normal HttpClient instance for execution instead of having to work with
> a completely new HTTP request / response abstraction and a complete set
> of new classes.
> HttpRequestBuilder builder = new HttpRequestBuilder();
> HttpUriRequest request = builder.by(GET_METHOD).build();
> Just an idea for you to consider.
> Oleg
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org

Best regards,

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message