org.ektorp.http
Class StdHttpClient

java.lang.Object
  extended by org.ektorp.http.StdHttpClient
All Implemented Interfaces:
HttpClient

public class StdHttpClient
extends Object
implements HttpClient

Author:
henrik lundgren

Nested Class Summary
static class StdHttpClient.Builder
           
static class StdHttpClient.WithCachingBuilder
           
 
Constructor Summary
StdHttpClient(org.apache.http.client.HttpClient hc)
           
StdHttpClient(org.apache.http.client.HttpClient hc, org.apache.http.client.HttpClient backend)
           
 
Method Summary
 HttpResponse copy(String sourceUri, String destination)
           
protected  HttpResponse createHttpResponse(org.apache.http.HttpResponse rsp, org.apache.http.client.methods.HttpUriRequest httpRequest)
           
 HttpResponse delete(String uri)
           
protected  HttpResponse executePutPost(org.apache.http.client.methods.HttpEntityEnclosingRequestBase request, String content, boolean useBackend)
           
protected  HttpResponse executeRequest(org.apache.http.client.methods.HttpRequestBase request)
           
protected  HttpResponse executeRequest(org.apache.http.client.methods.HttpRequestBase request, Map<String,String> headers)
           
protected  HttpResponse executeRequest(org.apache.http.client.methods.HttpUriRequest request, boolean useBackend)
           
 HttpResponse get(String uri)
           
 HttpResponse get(String uri, Map<String,String> headers)
           
 org.apache.http.client.HttpClient getBackend()
           
 org.apache.http.client.HttpClient getClient()
           
protected  org.apache.http.HttpHost getHttpHost()
           
 HttpResponse getUncached(String uri)
           
 HttpResponse head(String uri)
           
 HttpResponse post(String uri, org.apache.http.HttpEntity httpEntity)
           
 HttpResponse post(String uri, InputStream content)
           
 HttpResponse post(String uri, String content)
           
 HttpResponse postUncached(String uri, String content)
           
 HttpResponse put(String uri)
           
 HttpResponse put(String uri, org.apache.http.HttpEntity httpEntity)
           
 HttpResponse put(String uri, InputStream data, String contentType, long contentLength)
           
 HttpResponse put(String uri, String content)
           
 void shutdown()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StdHttpClient

public StdHttpClient(org.apache.http.client.HttpClient hc)

StdHttpClient

public StdHttpClient(org.apache.http.client.HttpClient hc,
                     org.apache.http.client.HttpClient backend)
Method Detail

getClient

public org.apache.http.client.HttpClient getClient()

getBackend

public org.apache.http.client.HttpClient getBackend()

delete

public HttpResponse delete(String uri)
Specified by:
delete in interface HttpClient

get

public HttpResponse get(String uri)
Specified by:
get in interface HttpClient

get

public HttpResponse get(String uri,
                        Map<String,String> headers)
Specified by:
get in interface HttpClient

getUncached

public HttpResponse getUncached(String uri)
Specified by:
getUncached in interface HttpClient

postUncached

public HttpResponse postUncached(String uri,
                                 String content)
Specified by:
postUncached in interface HttpClient

post

public HttpResponse post(String uri,
                         String content)
Specified by:
post in interface HttpClient

post

public HttpResponse post(String uri,
                         InputStream content)
Specified by:
post in interface HttpClient

post

public HttpResponse post(String uri,
                         org.apache.http.HttpEntity httpEntity)
Specified by:
post in interface HttpClient

put

public HttpResponse put(String uri,
                        String content)
Specified by:
put in interface HttpClient

put

public HttpResponse put(String uri)
Specified by:
put in interface HttpClient

put

public HttpResponse put(String uri,
                        InputStream data,
                        String contentType,
                        long contentLength)
Specified by:
put in interface HttpClient

put

public HttpResponse put(String uri,
                        org.apache.http.HttpEntity httpEntity)
Specified by:
put in interface HttpClient

head

public HttpResponse head(String uri)
Specified by:
head in interface HttpClient

executePutPost

protected HttpResponse executePutPost(org.apache.http.client.methods.HttpEntityEnclosingRequestBase request,
                                      String content,
                                      boolean useBackend)

executeRequest

protected HttpResponse executeRequest(org.apache.http.client.methods.HttpRequestBase request,
                                      Map<String,String> headers)

executeRequest

protected HttpResponse executeRequest(org.apache.http.client.methods.HttpUriRequest request,
                                      boolean useBackend)

createHttpResponse

protected HttpResponse createHttpResponse(org.apache.http.HttpResponse rsp,
                                          org.apache.http.client.methods.HttpUriRequest httpRequest)

executeRequest

protected HttpResponse executeRequest(org.apache.http.client.methods.HttpRequestBase request)

copy

public HttpResponse copy(String sourceUri,
                         String destination)
Specified by:
copy in interface HttpClient

shutdown

public void shutdown()
Specified by:
shutdown in interface HttpClient

getHttpHost

protected org.apache.http.HttpHost getHttpHost()


Copyright © 2017. All rights reserved.