kevinsawicki / http-request

Java HTTP Request Library
http://kevinsawicki.github.io/http-request
MIT License
3.35k stars 844 forks source link

Default request configutation #17

Open tprochazka opened 11 years ago

tprochazka commented 11 years ago

One of the biggest issue of this library is absence of the possibility to pre configure request. I mean situation when I want to add some headers, url parameters or enable GZIP for all request.

Something like

HttpRequest.buildDefaults().
   .header("version", "1.0.0")
   .parameter("locale","en")
   .acceptGzipEncoding().uncompress(true);

will be great

casidiablo commented 11 years ago

:+1:

patrick91 commented 10 years ago

Shall we put a list of the options that we can preconfigure? So we can discuss about how to develop this new feature.

tprochazka commented 10 years ago

I think that everything, that is possible to set before request execution. For example enable gzip encoding, default headers, parameters, etc. Best would be use normal fluent api to build request and then save it as default, that will be used for every new requests.