org.apache.hc.client5.http.fluent

## Class Executor

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

-     public class Executor
      extends Object

  Executor for `Request`s.

  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 and Description
    --- | ---
    `Executor` | `auth(AuthScope authScope, Credentials credentials)`
    `Executor` | `auth(org.apache.hc.core5.http.HttpHost host, Credentials credentials)`
    `Executor` | `auth(org.apache.hc.core5.http.HttpHost host, String username, char[] password)`
    `Executor` | `auth(org.apache.hc.core5.http.HttpHost host, String username, char[] password, String workstation, String domain)` Deprecated. Use `auth(HttpHost, String, char[])`.
    `Executor` | `auth(String host, Credentials credentials)`
    `Executor` | `authPreemptive(org.apache.hc.core5.http.HttpHost host)`
    `Executor` | `authPreemptive(String host)`
    `Executor` | `authPreemptiveProxy(org.apache.hc.core5.http.HttpHost proxy)`
    `Executor` | `authPreemptiveProxy(String proxy)`
    `Executor` | `clearAuth()`
    `Executor` | `clearCookies()`
    `Response` | `execute(Request request)` Executes the request.
    `static Executor` | `newInstance()`
    `static Executor` | `newInstance(CloseableHttpClient httpclient)`
    `Executor` | `use(CookieStore cookieStore)`
    `Executor` | `use(CredentialsStore credentialsStore)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### newInstance

          public static Executor newInstance()

    - #### newInstance

          public static Executor newInstance(CloseableHttpClient httpclient)

    - #### use

          public Executor use(CredentialsStore credentialsStore)

      Since:
        4.5

    - #### auth

          public Executor auth(AuthScope authScope,
                               Credentials credentials)

    - #### auth

          public Executor auth(org.apache.hc.core5.http.HttpHost host,
                               Credentials credentials)

    - #### auth

          public Executor auth(String host,
                               Credentials credentials)

      Since:
        4.4

    - #### authPreemptive

          public Executor authPreemptive(org.apache.hc.core5.http.HttpHost host)

    - #### authPreemptive

          public Executor authPreemptive(String host)

      Since:
        4.4

    - #### authPreemptiveProxy

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

    - #### authPreemptiveProxy

          public Executor authPreemptiveProxy(String proxy)

      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)

      Deprecated. Use `auth(HttpHost, String, char[])`.

    - #### clearAuth

          public Executor clearAuth()

    - #### use

          public Executor use(CookieStore cookieStore)

      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:
        `Response.handleResponse(org.apache.hc.core5.http.io.HttpClientResponseHandler)`, `Response.discardContent()`

Copyright © 1999–2021 The Apache Software Foundation. All rights reserved.