public abstract class CloseableHttpClient extends java.lang.Object implements HttpClient
HttpClient that also implements ModalCloseable.| Constructor and Description |
|---|
CloseableHttpClient() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract CloseableHttpResponse |
doExecute(HttpHost target,
ClassicHttpRequest request,
HttpContext context) |
CloseableHttpResponse |
execute(ClassicHttpRequest request)
Executes HTTP request using the default context.
|
<T> T |
execute(ClassicHttpRequest request,
<any> responseHandler)
Executes a request using the default context and processes the
response using the given response handler.
|
CloseableHttpResponse |
execute(ClassicHttpRequest request,
HttpContext context)
Executes HTTP request using the given context.
|
<T> T |
execute(ClassicHttpRequest request,
HttpContext context,
<any> responseHandler)
Executes a request using the default context and processes the
response using the given response handler.
|
CloseableHttpResponse |
execute(HttpHost target,
ClassicHttpRequest request)
Executes HTTP request using the given context.
|
<T> T |
execute(HttpHost target,
ClassicHttpRequest request,
<any> responseHandler)
Executes a request using the default context and processes the
response using the given response handler.
|
CloseableHttpResponse |
execute(HttpHost target,
ClassicHttpRequest request,
HttpContext context)
Executes HTTP request using the given context.
|
<T> T |
execute(HttpHost target,
ClassicHttpRequest request,
HttpContext context,
<any> responseHandler)
Executes a request using the default context and processes the
response using the given response handler.
|
protected abstract CloseableHttpResponse doExecute(HttpHost target, ClassicHttpRequest request, HttpContext context) throws java.io.IOException
java.io.IOExceptionpublic CloseableHttpResponse execute(HttpHost target, ClassicHttpRequest request, HttpContext context) throws java.io.IOException
HttpClientexecute in interface HttpClienttarget - the target host for the request.
Implementations may accept null
if they can still determine a route, for example
to a default target or by inspecting the request.request - the request to executecontext - the context to use for the execution, or
null to use the default contextjava.io.IOException - in case of a problem or the connection was abortedpublic CloseableHttpResponse execute(ClassicHttpRequest request, HttpContext context) throws java.io.IOException
HttpClientexecute in interface HttpClientrequest - the request to executecontext - the context to use for the execution, or
null to use the default contextjava.io.IOException - in case of a problem or the connection was abortedpublic CloseableHttpResponse execute(ClassicHttpRequest request) throws java.io.IOException
HttpClientexecute in interface HttpClientrequest - the request to executejava.io.IOException - in case of a problem or the connection was abortedpublic CloseableHttpResponse execute(HttpHost target, ClassicHttpRequest request) throws java.io.IOException
HttpClientexecute in interface HttpClienttarget - the request to executerequest - the context to use for the execution, or
null to use the default contextjava.io.IOException - in case of a problem or the connection was abortedpublic <T> T execute(ClassicHttpRequest request,
<any> responseHandler)
throws java.io.IOException
HttpClientResponseHandlers from having to manage
resource deallocation internally.execute in interface HttpClientrequest - the request to executeresponseHandler - the response handlerjava.io.IOException - in case of a problem or the connection was abortedClientProtocolException - in case of an http protocol errorpublic <T> T execute(ClassicHttpRequest request,
HttpContext context,
<any> responseHandler)
throws java.io.IOException
HttpClientResponseHandlers from having to manage
resource deallocation internally.execute in interface HttpClientrequest - the request to executeresponseHandler - the response handlercontext - the context to use for the execution, or
null to use the default contextjava.io.IOException - in case of a problem or the connection was abortedClientProtocolException - in case of an http protocol errorpublic <T> T execute(HttpHost target,
ClassicHttpRequest request,
<any> responseHandler)
throws java.io.IOException
HttpClientResponseHandlers from having to manage
resource deallocation internally.execute in interface HttpClienttarget - the target host for the request.
Implementations may accept null
if they can still determine a route, for example
to a default target or by inspecting the request.request - the request to executeresponseHandler - the response handlerjava.io.IOException - in case of a problem or the connection was abortedClientProtocolException - in case of an http protocol errorpublic <T> T execute(HttpHost target,
ClassicHttpRequest request,
HttpContext context,
<any> responseHandler)
throws java.io.IOException
HttpClientResponseHandlers from having to manage
resource deallocation internally.execute in interface HttpClienttarget - the target host for the request.
Implementations may accept null
if they can still determine a route, for example
to a default target or by inspecting the request.request - the request to executecontext - the context to use for the execution, or
null to use the default contextresponseHandler - the response handlerjava.io.IOException - in case of a problem or the connection was abortedClientProtocolException - in case of an http protocol error