public interface HttpClient
| Modifier and Type | Method and Description |
|---|---|
HttpResponse |
send(HttpRequest request,
int responseTimeout,
boolean followRedirects,
HttpRequestAuthentication authentication)
Sends a HttpRequest blocking the current thread until a response is available or the request times out.
|
void |
send(HttpRequest request,
int responseTimeout,
boolean followRedirects,
HttpRequestAuthentication authentication,
ResponseHandler handler)
Sends a HttpRequest without blocking the current thread.
|
void |
start()
Fully configures the client, leaving it ready to use.
|
void |
stop()
Disables the client.
|
void start()
void stop()
HttpResponse send(HttpRequest request, int responseTimeout, boolean followRedirects, HttpRequestAuthentication authentication) throws IOException, TimeoutException
request - the HttpRequest to sendresponseTimeout - the time (in milliseconds) to wait for a responsefollowRedirects - whether or not to follow redirect responsesauthentication - the optional HttpRequestAuthentication to useHttpResponseIOException - if an error occurs while executingTimeoutException - if responseTimeout is exceededvoid send(HttpRequest request, int responseTimeout, boolean followRedirects, HttpRequestAuthentication authentication, ResponseHandler handler)
ResponseHandler will be invoked. Be aware that the response body processing will be deferred so that the response can
be processed even when a large body is still being received. If the full response is needed right away then the provided
ResponseHandler must execute in a different thread so that it does not block the HttpClient threads handling
the response.request - the HttpRequest to sendresponseTimeout - the time (in milliseconds) to wait for a responsefollowRedirects - whether or not to follow redirect responsesauthentication - the optional HttpRequestAuthentication to usehandler - the ResponseHandler to be invoked when the HttpResponse is ready.Copyright © 2003–2017 MuleSoft, Inc.. All rights reserved.