Class Executor

java.lang.Object
org.apache.hc.client5.http.fluent.Executor

public class Executor extends Object
Executor for Requests.

A connection pool with maximum 100 connections per route and a total maximum of 200 connections is used internally.

Since:
4.2
  • Method Details

    • 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(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(String host)
      Returns:
      this instance.
      Since:
      4.4
    • authPreemptiveProxy

      public Executor authPreemptiveProxy(org.apache.hc.core5.http.HttpHost proxy)
    • authPreemptiveProxy

      public Executor authPreemptiveProxy(String proxy)
      Returns:
      this instance.
      Since:
      4.4
    • auth

      public Executor auth(org.apache.hc.core5.http.HttpHost host, String username, char[] password)
    • auth

      @Deprecated public Executor auth(org.apache.hc.core5.http.HttpHost host, String username, char[] password, String workstation, String domain)
      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 IOException
      Executes the request. Please Note that response content must be processed or discarded using Response.discardContent(), otherwise the connection used for the request might not be released to the pool.
      Throws:
      IOException
      See Also: