Class Executor
- java.lang.Object
-
- org.apache.hc.client5.http.fluent.Executor
-
public class Executor extends java.lang.ObjectExecutor forRequests.A connection pool with maximum 100 connections per route and a total maximum of 200 connections is used internally.
- Since:
- 4.2
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Executorauth(java.lang.String host, org.apache.hc.client5.http.auth.Credentials credentials)Executorauth(org.apache.hc.client5.http.auth.AuthScope authScope, org.apache.hc.client5.http.auth.Credentials credentials)Executorauth(org.apache.hc.core5.http.HttpHost host, java.lang.String username, char[] password)Executorauth(org.apache.hc.core5.http.HttpHost host, java.lang.String username, char[] password, java.lang.String workstation, java.lang.String domain)Deprecated.Executorauth(org.apache.hc.core5.http.HttpHost host, org.apache.hc.client5.http.auth.Credentials credentials)ExecutorauthPreemptive(java.lang.String host)ExecutorauthPreemptive(org.apache.hc.core5.http.HttpHost host)ExecutorauthPreemptiveProxy(java.lang.String proxy)ExecutorauthPreemptiveProxy(org.apache.hc.core5.http.HttpHost proxy)ExecutorclearAuth()ExecutorclearCookies()Responseexecute(Request request)Executes the request.static ExecutornewInstance()static ExecutornewInstance(org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient httpclient)This feature is considered experimental and may be discontinued in the future.static ExecutornewInstance(org.apache.hc.client5.http.impl.classic.CloseableHttpClient httpclient)Executoruse(org.apache.hc.client5.http.auth.CredentialsStore credentialsStore)Executoruse(org.apache.hc.client5.http.cookie.CookieStore cookieStore)
-
-
-
Method Detail
-
newInstance
public static Executor newInstance()
-
newInstance
public static Executor newInstance(org.apache.hc.client5.http.impl.classic.CloseableHttpClient httpclient)
-
newInstance
@Experimental public static Executor newInstance(org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient httpclient)
This feature is considered experimental and may be discontinued in the future.- Since:
- 5.5
-
use
public Executor use(org.apache.hc.client5.http.auth.CredentialsStore credentialsStore)
- Returns:
- this instance.
- Since:
- 4.5
-
auth
public Executor auth(org.apache.hc.client5.http.auth.AuthScope authScope, org.apache.hc.client5.http.auth.Credentials credentials)
-
auth
public Executor auth(org.apache.hc.core5.http.HttpHost host, org.apache.hc.client5.http.auth.Credentials credentials)
-
auth
public Executor auth(java.lang.String host, org.apache.hc.client5.http.auth.Credentials credentials)
- Returns:
- this instance.
- Since:
- 4.4
-
authPreemptive
public Executor authPreemptive(org.apache.hc.core5.http.HttpHost host)
-
authPreemptive
public Executor authPreemptive(java.lang.String host)
- Returns:
- this instance.
- Since:
- 4.4
-
authPreemptiveProxy
public Executor authPreemptiveProxy(org.apache.hc.core5.http.HttpHost proxy)
-
authPreemptiveProxy
public Executor authPreemptiveProxy(java.lang.String proxy)
- Returns:
- this instance.
- Since:
- 4.4
-
auth
public Executor auth(org.apache.hc.core5.http.HttpHost host, java.lang.String username, char[] password)
-
auth
@Deprecated public Executor auth(org.apache.hc.core5.http.HttpHost host, java.lang.String username, char[] password, java.lang.String workstation, java.lang.String domain)
Deprecated.- Returns:
- this instance.
-
clearAuth
public Executor clearAuth()
-
use
public Executor use(org.apache.hc.client5.http.cookie.CookieStore cookieStore)
- Returns:
- this instance.
- Since:
- 4.5
-
clearCookies
public Executor clearCookies()
-
execute
public Response execute(Request request) throws java.io.IOException
Executes the request. Please Note that response content must be processed or discarded usingResponse.discardContent(), otherwise the connection used for the request might not be released to the pool.- Throws:
java.io.IOException- See Also:
Response.handleResponse(org.apache.hc.core5.http.io.HttpClientResponseHandler),Response.discardContent()
-
-