public interface HttpClient
Modifier and Type | Method and Description |
---|---|
org.apache.hc.core5.http.HttpResponse |
execute(org.apache.hc.core5.http.ClassicHttpRequest request)
Deprecated.
It is strongly recommended to use execute methods with
HttpClientResponseHandler
such as execute(ClassicHttpRequest, HttpClientResponseHandler) in order
to ensure automatic resource deallocation by the client.
For special cases one can still use executeOpen(HttpHost, ClassicHttpRequest, HttpContext)
to keep the response object open after the request execution. |
<T> T |
execute(org.apache.hc.core5.http.ClassicHttpRequest request,
org.apache.hc.core5.http.io.HttpClientResponseHandler<? extends T> responseHandler)
Executes HTTP request using the default context and processes the
response using the given response handler.
|
org.apache.hc.core5.http.HttpResponse |
execute(org.apache.hc.core5.http.ClassicHttpRequest request,
org.apache.hc.core5.http.protocol.HttpContext context)
Deprecated.
It is strongly recommended to use execute methods with
HttpClientResponseHandler
such as execute(ClassicHttpRequest, HttpContext, HttpClientResponseHandler) in order
to ensure automatic resource deallocation by the client.
For special cases one can still use executeOpen(HttpHost, ClassicHttpRequest, HttpContext)
to keep the response object open after the request execution. |
<T> T |
execute(org.apache.hc.core5.http.ClassicHttpRequest request,
org.apache.hc.core5.http.protocol.HttpContext context,
org.apache.hc.core5.http.io.HttpClientResponseHandler<? extends T> responseHandler)
Executes HTTP request using the given context and processes the
response using the given response handler.
|
org.apache.hc.core5.http.ClassicHttpResponse |
execute(org.apache.hc.core5.http.HttpHost target,
org.apache.hc.core5.http.ClassicHttpRequest request)
Deprecated.
It is strongly recommended to use execute methods with
HttpClientResponseHandler
such as execute(HttpHost, ClassicHttpRequest, HttpClientResponseHandler) in order
to ensure automatic resource deallocation by the client.
For special cases one can still use executeOpen(HttpHost, ClassicHttpRequest, HttpContext)
to keep the response object open after the request execution. |
<T> T |
execute(org.apache.hc.core5.http.HttpHost target,
org.apache.hc.core5.http.ClassicHttpRequest request,
org.apache.hc.core5.http.io.HttpClientResponseHandler<? extends T> responseHandler)
Executes HTTP request to the target using the default context and
processes the response using the given response handler.
|
org.apache.hc.core5.http.HttpResponse |
execute(org.apache.hc.core5.http.HttpHost target,
org.apache.hc.core5.http.ClassicHttpRequest request,
org.apache.hc.core5.http.protocol.HttpContext context)
Deprecated.
It is strongly recommended to use execute methods with
HttpClientResponseHandler
such as execute(HttpHost, ClassicHttpRequest, HttpContext, HttpClientResponseHandler) in order
to ensure automatic resource deallocation by the client.
For special cases one can still use executeOpen(HttpHost, ClassicHttpRequest, HttpContext)
to keep the response object open after the request execution. |
<T> T |
execute(org.apache.hc.core5.http.HttpHost target,
org.apache.hc.core5.http.ClassicHttpRequest request,
org.apache.hc.core5.http.protocol.HttpContext context,
org.apache.hc.core5.http.io.HttpClientResponseHandler<? extends T> responseHandler)
Executes HTTP request to the target using the given context and
processes the response using the given response handler.
|
default org.apache.hc.core5.http.ClassicHttpResponse |
executeOpen(org.apache.hc.core5.http.HttpHost target,
org.apache.hc.core5.http.ClassicHttpRequest request,
org.apache.hc.core5.http.protocol.HttpContext context)
Executes the request and opens the response stream using the given context.
|
@Deprecated org.apache.hc.core5.http.HttpResponse execute(org.apache.hc.core5.http.ClassicHttpRequest request) throws IOException
HttpClientResponseHandler
such as execute(ClassicHttpRequest, HttpClientResponseHandler)
in order
to ensure automatic resource deallocation by the client.
For special cases one can still use executeOpen(HttpHost, ClassicHttpRequest, HttpContext)
to keep the response object open after the request execution.request
- the request to executeIOException
- in case of a problem or the connection was abortedexecute(ClassicHttpRequest, HttpClientResponseHandler)
,
executeOpen(HttpHost, ClassicHttpRequest, HttpContext)
@Deprecated org.apache.hc.core5.http.HttpResponse execute(org.apache.hc.core5.http.ClassicHttpRequest request, org.apache.hc.core5.http.protocol.HttpContext context) throws IOException
HttpClientResponseHandler
such as execute(ClassicHttpRequest, HttpContext, HttpClientResponseHandler)
in order
to ensure automatic resource deallocation by the client.
For special cases one can still use executeOpen(HttpHost, ClassicHttpRequest, HttpContext)
to keep the response object open after the request execution.request
- the request to executecontext
- the context to use for the execution, or
null
to use the default contextIOException
- in case of a problem or the connection was abortedexecute(ClassicHttpRequest, HttpContext, HttpClientResponseHandler)
,
executeOpen(HttpHost, ClassicHttpRequest, HttpContext)
@Deprecated org.apache.hc.core5.http.ClassicHttpResponse execute(org.apache.hc.core5.http.HttpHost target, org.apache.hc.core5.http.ClassicHttpRequest request) throws IOException
HttpClientResponseHandler
such as execute(HttpHost, ClassicHttpRequest, HttpClientResponseHandler)
in order
to ensure automatic resource deallocation by the client.
For special cases one can still use executeOpen(HttpHost, ClassicHttpRequest, HttpContext)
to keep the response object open after the request execution.target
- 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 executeIOException
- in case of a problem or the connection was abortedexecute(HttpHost, ClassicHttpRequest, HttpClientResponseHandler)
,
executeOpen(HttpHost, ClassicHttpRequest, HttpContext)
@Deprecated org.apache.hc.core5.http.HttpResponse execute(org.apache.hc.core5.http.HttpHost target, org.apache.hc.core5.http.ClassicHttpRequest request, org.apache.hc.core5.http.protocol.HttpContext context) throws IOException
HttpClientResponseHandler
such as execute(HttpHost, ClassicHttpRequest, HttpContext, HttpClientResponseHandler)
in order
to ensure automatic resource deallocation by the client.
For special cases one can still use executeOpen(HttpHost, ClassicHttpRequest, HttpContext)
to keep the response object open after the request execution.target
- 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 contextIOException
- in case of a problem or the connection was abortedexecute(HttpHost, ClassicHttpRequest, HttpContext, HttpClientResponseHandler)
,
executeOpen(HttpHost, ClassicHttpRequest, HttpContext)
default org.apache.hc.core5.http.ClassicHttpResponse executeOpen(org.apache.hc.core5.http.HttpHost target, org.apache.hc.core5.http.ClassicHttpRequest request, org.apache.hc.core5.http.protocol.HttpContext context) throws IOException
target
- 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 contextCloseable.close()
in order ensure deallocation
of system resources.IOException
- in case of a problem or the connection was aborted<T> T execute(org.apache.hc.core5.http.ClassicHttpRequest request, org.apache.hc.core5.http.io.HttpClientResponseHandler<? extends T> responseHandler) throws IOException
Implementing classes are required to ensure that the content entity
associated with the response is fully consumed and the underlying
connection is released back to the connection manager automatically
in all cases relieving individual HttpClientResponseHandler
s from
having to manage resource deallocation internally.
T
- the type of the value determined by the response.request
- the request to executeresponseHandler
- the response handlerIOException
- in case of a problem or the connection was aborted<T> T execute(org.apache.hc.core5.http.ClassicHttpRequest request, org.apache.hc.core5.http.protocol.HttpContext context, org.apache.hc.core5.http.io.HttpClientResponseHandler<? extends T> responseHandler) throws IOException
Implementing classes are required to ensure that the content entity
associated with the response is fully consumed and the underlying
connection is released back to the connection manager automatically
in all cases relieving individual HttpClientResponseHandler
s from
having to manage resource deallocation internally.
T
- the type of the value determined by the response.request
- the request to executecontext
- the context to use for the execution, or
null
to use the default contextresponseHandler
- the response handlerIOException
- in case of a problem or the connection was aborted<T> T execute(org.apache.hc.core5.http.HttpHost target, org.apache.hc.core5.http.ClassicHttpRequest request, org.apache.hc.core5.http.io.HttpClientResponseHandler<? extends T> responseHandler) throws IOException
Implementing classes are required to ensure that the content entity
associated with the response is fully consumed and the underlying
connection is released back to the connection manager automatically
in all cases relieving individual HttpClientResponseHandler
s from
having to manage resource deallocation internally.
T
- the type of the value determined by the response.target
- 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 handlerIOException
- in case of a problem or the connection was aborted<T> T execute(org.apache.hc.core5.http.HttpHost target, org.apache.hc.core5.http.ClassicHttpRequest request, org.apache.hc.core5.http.protocol.HttpContext context, org.apache.hc.core5.http.io.HttpClientResponseHandler<? extends T> responseHandler) throws IOException
Implementing classes are required to ensure that the content entity
associated with the response is fully consumed and the underlying
connection is released back to the connection manager automatically
in all cases relieving individual HttpClientResponseHandler
s from
having to manage resource deallocation internally.
T
- the type of the value determined by the response.target
- 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 handlerIOException
- in case of a problem or the connection was abortedCopyright © 1999–2021 The Apache Software Foundation. All rights reserved.