# Deprecated API

## Contents

- Deprecated Interfaces
- Deprecated Classes
- Deprecated Fields
- Deprecated Methods
- Deprecated Constructors

- Deprecated Interfaces
  Interface and Description
  org.apache.hc.client5.http.impl.MessageCopier Use message builders.

- Deprecated Classes
  Class and Description
  org.apache.hc.client5.http.async.methods.BasicHttpRequests Use `BasicRequestBuilder`.
  org.apache.hc.client5.http.classic.methods.ClassicHttpRequests Use `ClassicRequestBuilder`
  org.apache.hc.client5.http.impl.classic.ClassicRequestCopier Use `ClassicRequestBuilder`
  org.apache.hc.client5.http.async.methods.IgnoreCompleteExceptonFutureCallback Use `IgnoreCompleteExceptionFutureCallback`
  org.apache.hc.client5.http.protocol.RequestAuthCache Do not use.
  org.apache.hc.client5.http.impl.RequestCopier Use `BasicRequestBuilder`
  org.apache.hc.client5.http.async.methods.SimpleHttpRequests Use `SimpleRequestBuilder`.

- Deprecated Fields
  Field and Description
  org.apache.hc.client5.http.fluent.Request.DATE_FORMAT This attribute is no longer supported as a part of the public API.
  org.apache.hc.client5.http.fluent.Request.DATE_LOCALE This attribute is no longer supported as a part of the public API.
  org.apache.hc.client5.http.utils.DateUtils.GMT This attribute is no longer supported as a part of the public API.
  org.apache.hc.client5.http.fluent.Request.TIME_ZONE This attribute is no longer supported as a part of the public API.

- Deprecated Methods
  Method and Description
  org.apache.hc.client5.http.cookie.CookieStore.clearExpired(Date) Use `CookieStore.clearExpired(Instant)`
  org.apache.hc.client5.http.utils.DateUtils.clearThreadLocal() Noop method. Do not use.
  org.apache.hc.client5.http.async.methods.SimpleHttpRequest.copy(HttpRequest) Use `SimpleRequestBuilder`
  org.apache.hc.client5.http.utils.URIUtils.create(HttpHost, String) Use `URIBuilder`.
  org.apache.hc.client5.http.utils.URIUtils.create(String, URIAuthority, String) Use `URIBuilder`.
  org.apache.hc.client5.http.impl.async.HttpAsyncClients.createMinimal(HttpVersionPolicy, H2Config, Http1Config, IOReactorConfig) Use `HttpAsyncClients.createMinimal(H2Config, Http1Config, IOReactorConfig)`
  org.apache.hc.client5.http.impl.async.HttpAsyncClients.createMinimal(HttpVersionPolicy, H2Config, Http1Config, IOReactorConfig, AsyncClientConnectionManager) Use `HttpAsyncClients.createMinimal(H2Config, Http1Config, IOReactorConfig, AsyncClientConnectionManager)`
  org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(ClassicHttpRequest) It is strongly recommended to use execute methods with `HttpClientResponseHandler` such as `CloseableHttpClient.execute(ClassicHttpRequest, HttpClientResponseHandler)` in order to ensure automatic resource deallocation by the client. For special cases one can still use `HttpClient.executeOpen(HttpHost, ClassicHttpRequest, HttpContext)` to keep the response object open after the request execution.
  org.apache.hc.client5.http.classic.HttpClient.execute(ClassicHttpRequest) It is strongly recommended to use execute methods with `HttpClientResponseHandler` such as `HttpClient.execute(ClassicHttpRequest, HttpClientResponseHandler)` in order to ensure automatic resource deallocation by the client. For special cases one can still use `HttpClient.executeOpen(HttpHost, ClassicHttpRequest, HttpContext)` to keep the response object open after the request execution.
  org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(ClassicHttpRequest, HttpContext) It is strongly recommended to use execute methods with `HttpClientResponseHandler` such as `CloseableHttpClient.execute(ClassicHttpRequest, HttpContext, HttpClientResponseHandler)` in order to ensure automatic resource deallocation by the client. For special cases one can still use `HttpClient.executeOpen(HttpHost, ClassicHttpRequest, HttpContext)` to keep the response object open after the request execution.
  org.apache.hc.client5.http.classic.HttpClient.execute(ClassicHttpRequest, HttpContext) It is strongly recommended to use execute methods with `HttpClientResponseHandler` such as `HttpClient.execute(ClassicHttpRequest, HttpContext, HttpClientResponseHandler)` in order to ensure automatic resource deallocation by the client. For special cases one can still use `HttpClient.executeOpen(HttpHost, ClassicHttpRequest, HttpContext)` to keep the response object open after the request execution.
  org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(HttpHost, ClassicHttpRequest) It is strongly recommended to use execute methods with `HttpClientResponseHandler` such as `CloseableHttpClient.execute(HttpHost, ClassicHttpRequest, HttpClientResponseHandler)` in order to ensure automatic resource deallocation by the client. For special cases one can still use `HttpClient.executeOpen(HttpHost, ClassicHttpRequest, HttpContext)` to keep the response object open after the request execution.
  org.apache.hc.client5.http.classic.HttpClient.execute(HttpHost, ClassicHttpRequest) It is strongly recommended to use execute methods with `HttpClientResponseHandler` such as `HttpClient.execute(HttpHost, ClassicHttpRequest, HttpClientResponseHandler)` in order to ensure automatic resource deallocation by the client. For special cases one can still use `HttpClient.executeOpen(HttpHost, ClassicHttpRequest, HttpContext)` to keep the response object open after the request execution.
  org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(HttpHost, ClassicHttpRequest, HttpContext) It is strongly recommended to use execute methods with `HttpClientResponseHandler` such as `CloseableHttpClient.execute(HttpHost, ClassicHttpRequest, HttpContext, HttpClientResponseHandler)` in order to ensure automatic resource deallocation by the client. For special cases one can still use `HttpClient.executeOpen(HttpHost, ClassicHttpRequest, HttpContext)` to keep the response object open after the request execution.
  org.apache.hc.client5.http.classic.HttpClient.execute(HttpHost, ClassicHttpRequest, HttpContext) It is strongly recommended to use execute methods with `HttpClientResponseHandler` such as `HttpClient.execute(HttpHost, ClassicHttpRequest, HttpContext, HttpClientResponseHandler)` in order to ensure automatic resource deallocation by the client. For special cases one can still use `HttpClient.executeOpen(HttpHost, ClassicHttpRequest, HttpContext)` to keep the response object open after the request execution.
  org.apache.hc.client5.http.utils.DateUtils.formatDate(Date) Use `DateUtils.formatStandardDate(Instant)`
  org.apache.hc.client5.http.utils.DateUtils.formatDate(Date, String) Use `DateUtils.formatDate(Instant, DateTimeFormatter)`
  org.apache.hc.client5.http.config.RequestConfig.getConnectTimeout() Use `ConnectionConfig.getConnectTimeout()`.
  org.apache.hc.client5.http.cookie.Cookie.getCreationDate() Use `Cookie.getCreationInstant()`
  org.apache.hc.client5.http.impl.cookie.BasicClientCookie.getCreationDate() Use `BasicClientCookie.getCreationInstant()`.
  org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager.getDefaultSocketConfig() Use custom `PoolingHttpClientConnectionManager.setConnectionConfigResolver(Resolver)`
  org.apache.hc.client5.http.cookie.Cookie.getExpiryDate() Use {`Cookie.getExpiryInstant()`}
  org.apache.hc.client5.http.impl.cookie.BasicClientCookie.getExpiryDate() Use `BasicClientCookie.getExpiryInstant()`
  org.apache.hc.client5.http.config.RequestConfig.getProxy() Use `DefaultProxyRoutePlanner` or a custom `HttpRoutePlanner`.
  org.apache.hc.client5.http.cache.HttpCacheEntry.getRequestDate() USe `HttpCacheEntry.getRequestInstant()`
  org.apache.hc.client5.http.cache.HttpCacheEntry.getResponseDate() Use `HttpCacheEntry.getResponseInstant()`
  org.apache.hc.client5.http.impl.nio.PoolingAsyncClientConnectionManager.getValidateAfterInactivity() Use custom `PoolingAsyncClientConnectionManager.setConnectionConfigResolver(Resolver)`
  org.apache.hc.client5.http.impl.io.BasicHttpClientConnectionManager.getValidateAfterInactivity() Use `BasicHttpClientConnectionManager.getConnectionConfig()`
  org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager.getValidateAfterInactivity() Use `PoolingHttpClientConnectionManager.setConnectionConfigResolver(Resolver)`.
  org.apache.hc.client5.http.utils.DateUtils.isAfter(MessageHeaders, MessageHeaders, String) This method is no longer supported as a part of the public API.
  org.apache.hc.client5.http.utils.DateUtils.isBefore(MessageHeaders, MessageHeaders, String) This method is no longer supported as a part of the public API.
  org.apache.hc.client5.http.cookie.Cookie.isExpired(Date) Use {`Cookie.isExpired(Instant)`}
  org.apache.hc.client5.http.impl.cookie.BasicClientCookie.isExpired(Date) Use `BasicClientCookie.isExpired(Instant)`
  org.apache.hc.client5.http.impl.cache.HttpCacheSupport.normalizeQuetly(String) Use `HttpCacheSupport.normalizeQuietly(String)`
  org.apache.hc.client5.http.utils.DateUtils.parseDate(MessageHeaders, String) Use `DateUtils.parseStandardDate(MessageHeaders, String)`
  org.apache.hc.client5.http.utils.DateUtils.parseDate(String) Use `DateUtils.parseStandardDate(String)`
  org.apache.hc.client5.http.utils.DateUtils.parseDate(String, String[]) Use `DateUtils.parseDate(String, DateTimeFormatter...)`
  org.apache.hc.client5.http.utils.DateUtils.parseDate(String, String[], Date) Use `DateUtils.parseDate(String, DateTimeFormatter...)`
  org.apache.hc.client5.http.utils.URIUtils.rewriteURI(URI) Use `URIBuilder`.
  org.apache.hc.client5.http.utils.URIUtils.rewriteURI(URI, HttpHost) Use `URIBuilder`.
  org.apache.hc.client5.http.utils.URIUtils.rewriteURI(URI, HttpHost, boolean) Use `URIBuilder`.
  org.apache.hc.client5.http.impl.nio.PoolingAsyncClientConnectionManagerBuilder.setConnectionTimeToLive(TimeValue) Use `PoolingAsyncClientConnectionManagerBuilder.setDefaultConnectionConfig(ConnectionConfig)`
  org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManagerBuilder.setConnectionTimeToLive(TimeValue) Use `PoolingHttpClientConnectionManagerBuilder.setDefaultConnectionConfig(ConnectionConfig)`.
  org.apache.hc.client5.http.config.RequestConfig.Builder.setConnectTimeout(long, TimeUnit) Use `ConnectionConfig.Builder.setConnectTimeout(long, TimeUnit)`.
  org.apache.hc.client5.http.config.RequestConfig.Builder.setConnectTimeout(Timeout) Use `ConnectionConfig.Builder.setConnectTimeout(Timeout)`.
  org.apache.hc.client5.http.impl.cookie.BasicClientCookie.setCreationDate(Date) Use `BasicClientCookie.setCreationDate(Instant)`
  org.apache.hc.client5.http.fluent.Request.setDate(Date) Use `Request.setDate(Instant)`
  org.apache.hc.client5.http.cookie.SetCookie.setExpiryDate(Date) Use {`SetCookie.setExpiryDate(Instant)`}
  org.apache.hc.client5.http.impl.cookie.BasicClientCookie.setExpiryDate(Date) Use {`BasicClientCookie.setExpiryDate(Instant)`}
  org.apache.hc.client5.http.fluent.Request.setIfModifiedSince(Date) Use `Request.setIfModifiedSince(Instant)`
  org.apache.hc.client5.http.fluent.Request.setIfUnmodifiedSince(Date) Use `Request.setIfUnmodifiedSince(Instant)`
  org.apache.hc.client5.http.config.RequestConfig.Builder.setProxy(HttpHost) Use `DefaultProxyRoutePlanner` or a custom `HttpRoutePlanner`.
  org.apache.hc.client5.http.ssl.ClientTlsStrategyBuilder.setTlsDetailsFactory(Factory<SSLEngine, TlsDetails>) Do not use.
  org.apache.hc.client5.http.impl.nio.PoolingAsyncClientConnectionManager.setValidateAfterInactivity(TimeValue) Use `PoolingAsyncClientConnectionManager.setConnectionConfigResolver(Resolver)`.
  org.apache.hc.client5.http.impl.nio.PoolingAsyncClientConnectionManagerBuilder.setValidateAfterInactivity(TimeValue) Use `PoolingAsyncClientConnectionManagerBuilder.setConnectionConfigResolver(Resolver)`.
  org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManagerBuilder.setValidateAfterInactivity(TimeValue) Use `PoolingHttpClientConnectionManagerBuilder.setDefaultConnectionConfig(ConnectionConfig)`.
  org.apache.hc.client5.http.impl.io.BasicHttpClientConnectionManager.setValidateAfterInactivity(TimeValue) Use `BasicHttpClientConnectionManager.setConnectionConfig(ConnectionConfig)`
  org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager.setValidateAfterInactivity(TimeValue) Use `PoolingHttpClientConnectionManager.setConnectionConfigResolver(Resolver)`.
  org.apache.hc.client5.http.impl.async.HttpAsyncClientBuilder.setVersionPolicy(HttpVersionPolicy) Use `TlsConfig` and connection manager methods

- Deprecated Constructors
  Constructor and Description
  org.apache.hc.client5.http.impl.cookie.BasicExpiresHandler(String[]) Use `BasicExpiresHandler(DateTimeFormatter...)`
  org.apache.hc.client5.http.ssl.DefaultClientTlsStrategy(SSLContext, String[], String[], SSLBufferMode, HostnameVerifier, Factory<SSLEngine, TlsDetails>) Use `DefaultClientTlsStrategy(SSLContext, String[], String[], SSLBufferMode, HostnameVerifier)`
  org.apache.hc.client5.http.cache.HttpCacheEntry(Date, Date, int, Header[], Resource) {`HttpCacheEntry(Instant, Instant, int, Header[], Resource)`}
  org.apache.hc.client5.http.cache.HttpCacheEntry(Date, Date, int, Header[], Resource, Map<String, String>) Use {`HttpCacheEntry(Instant, Instant, int, Header[], Resource, Map)`}
  org.apache.hc.client5.http.async.AsyncExecChain.Scope(String, HttpRoute, HttpRequest, CancellableDependency, HttpClientContext, AsyncExecRuntime) Use `Scope#Scope(String, HttpRoute, HttpRequest, CancellableDependency, HttpClientContext, AsyncExecRuntime, Scheduler, AtomicInteger)`

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