/** * Decorates the given {@link HttpClient} to be proxy aware. This decorated instance will use the standard * JRE proxy selector to obtain proxy information. * * @param httpclient * the {@link HttpClient} to decorate with proxy awareness. * @see ProxySelectorRoutePlanner */ public ProxyAwareHttpClient(HttpClient httpclient) { super(httpclient); decorateProxyAwareness(); }
public GzipEnabledHttpClient(HttpClient httpclient) { super(httpclient); addGzipInterceptors(getHttpClientToDecorate()); }
public HttpResponse executePost(String uri, String payloadToSend) throws HttpClientException { return httpclient.executePost(uri, payloadToSend); }
public HttpResponse executeGet(String uri) throws HttpClientException { return httpclient.executeGet(uri); }
public BasicAuthenticationHttpClient(HttpClient toDecorate) { super(toDecorate); addAuthenticationInterceptor(getHttpClientToDecorate()); }
private void decorateAuthtokenAwareness(String authtoken) { DefaultHttpClient clientToDecorate = getHttpClientToDecorate(); clientToDecorate.addRequestInterceptor(new AuthTokenInterceptor(authtoken)); }
private void decorateProxyAwareness() { DefaultHttpClient clientToDecorate = getHttpClientToDecorate(); clientToDecorate.setRoutePlanner(createProxyPlanner()); }
private void addGzipInterceptors(DefaultHttpClient httpclient) { httpclient.addRequestInterceptor(new GzipRequestInterceptor()); httpclient.addResponseInterceptor(new GzipResponseInterceptor()); }
protected HttpRequestInterceptor getAuthenticationIntercepter() { return new BasicAuthenticationInterceptor(); }
public DefaultHttpClient getHttpClientToDecorate() { return httpclient.getHttpClientToDecorate(); }
public HttpResponse executeMethod(HttpRequestBase method) throws HttpClientException { return httpclient.executeMethod(method); }
@Override protected HttpRequestInterceptor getAuthenticationIntercepter() { return new PreemptiveBasicAuthenticationInterceptor(); }
public HttpResponse executeMethod(HttpRequestBase method) throws HttpClientException { try { return httpclient.execute(method); } catch (IOException e) { throw new HttpClientException("Could not execute request.", e); } }
public synchronized void provideAuthentication(HttpHost host, String user, String pw) { this.credentials.put(host, new UserPasswordAuthentication(user, pw)); }
public HttpResponse executePost(String uri, String payloadToSend) throws HttpClientException { return executePost(uri, payloadToSend, ContentType.create("text/xml", Consts.UTF_8)); }
private void addAuthenticationInterceptor(DefaultHttpClient httpclient) { httpclient.addRequestInterceptor(getAuthenticationIntercepter(), 0); }
public HttpResponse executePost(String uri, XmlObject payloadToSend) throws HttpClientException { return httpclient.executePost(uri, payloadToSend); }
public HttpResponse executeGet(String baseUri, RequestParameters parameters) throws HttpClientException { return httpclient.executeGet(baseUri, parameters); }
public HttpResponse executePost(String uri, HttpEntity payloadToSend) throws HttpClientException { return httpclient.executePost(uri, payloadToSend); }
public HttpResponse executePost(String uri, String payloadToSend, ContentType contentType) throws HttpClientException { return httpclient.executePost(uri, payloadToSend, contentType); }