public
Created

Usage example

  • Download Gist
gistfile1.java
Java
1 2 3 4 5 6 7 8 9 10 11 12 13
public MyService(Config config) {
HttpClient.Builder builder = new HttpClient.Builder();
builder
.setUserAgent(config.value(Prop.USER_AGENT, String.class))
.setRequestTimeout(config.value(Prop.REQ_TIMEOUT,Integer.class))
// etc.etc….
.setCompression(config.value(Prop.COMPRESSION_ENABLED, Boolean.class));
if(config.value(Prop.PROXY_ENABLED,Boolean.class)){
Proxy proxy = config.value(Prop.PROXY,Proxy.class);
builder.setProxy(proxy);
}
client = builder.build();
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.