Top Deprecated
Apache HttpClient 5.3

Deprecated API


No API in this release is deprecated for removal.

Deprecated Item Summary

SinceDeprecated Item and Description
org.apache.hc.client5.http.auth.Credentials.getPassword()

Use specific credentials class that represent a username / password set of a security token.

org.apache.hc.client5.http.auth.KerberosConfig

Do not use. The GGS based experimental authentication schemes are no longer supported. Consider using Basic or Bearer authentication with TLS instead.

org.apache.hc.client5.http.auth.KerberosConfig.Builder.build()

Deprecated as a consequence of KerberosConfig being deprecated. See corresponding docs for further information.

org.apache.hc.client5.http.auth.KerberosConfig.DEFAULT

Deprecated as a consequence of KerberosConfig being deprecated. See corresponding docs for further information.

org.apache.hc.client5.http.auth.KerberosConfig.clone()

Deprecated as a consequence of KerberosConfig being deprecated. See corresponding docs for further information.

org.apache.hc.client5.http.auth.KerberosConfig.copy(final KerberosConfig config)

Deprecated as a consequence of KerberosConfig being deprecated. See corresponding docs for further information.

org.apache.hc.client5.http.auth.KerberosCredentials

Do not use. The GGS based experimental authentication schemes are no longer supported. Consider using Basic or Bearer authentication with TLS instead.

org.apache.hc.client5.http.auth.NTCredentials

Do not use. the NTLM authentication scheme is no longer supported. Consider using Basic or Bearer authentication with TLS instead.

org.apache.hc.client5.http.auth.StandardAuthScheme.KERBEROS

Do not use. The GGS based experimental authentication schemes are no longer supported. Consider using Basic or Bearer authentication with TLS instead.

org.apache.hc.client5.http.auth.StandardAuthScheme.NTLM

Do not use. the NTLM authentication scheme is no longer supported. Consider using Basic or Bearer authentication with TLS instead.

org.apache.hc.client5.http.auth.StandardAuthScheme.SPNEGO

Do not use. The GGS based experimental authentication schemes are no longer supported. Consider using Basic or Bearer authentication with TLS instead.

Returns:

the response to the request. This is always a final response, never an intermediate response with an 1xx status code. Whether redirects or authentication challenges will be returned or handled automatically depends on the implementation and configuration of this client.
org.apache.hc.client5.http.classic.HttpClient.execute
(ClassicHttpRequest
the request to execute
request
)

It is strongly recommended to use execute methods with HttpClientResponseHandler such as execute(ClassicHttpRequest, HttpClientResponseHandler) in order to ensure automatic resource deallocation by the client. For special cases one can still use executeOpen(HttpHost, ClassicHttpRequest, HttpContext) to keep the response object open after the request execution.

Returns:

the response to the request. This is always a final response, never an intermediate response with an 1xx status code. Whether redirects or authentication challenges will be returned or handled automatically depends on the implementation and configuration of this client.
org.apache.hc.client5.http.classic.HttpClient.execute
(ClassicHttpRequest
the request to execute
request
,
HttpContext
the context to use for the execution, or null to use the default context
context
)

It is strongly recommended to use execute methods with HttpClientResponseHandler such as execute(ClassicHttpRequest, HttpContext, HttpClientResponseHandler) in order to ensure automatic resource deallocation by the client. For special cases one can still use executeOpen(HttpHost, ClassicHttpRequest, HttpContext) to keep the response object open after the request execution.

Returns:

the response to the request. This is always a final response, never an intermediate response with an 1xx status code. Whether redirects or authentication challenges will be returned or handled automatically depends on the implementation and configuration of this client.
org.apache.hc.client5.http.classic.HttpClient.execute
(HttpHost
the target host for the request. Implementations may accept null if they can still determine a route, for example to a default target or by inspecting the request.
target
,
ClassicHttpRequest
the request to execute
request
)

It is strongly recommended to use execute methods with HttpClientResponseHandler such as execute(HttpHost, ClassicHttpRequest, HttpClientResponseHandler) in order to ensure automatic resource deallocation by the client. For special cases one can still use executeOpen(HttpHost, ClassicHttpRequest, HttpContext) to keep the response object open after the request execution.

Returns:

the response to the request. This is always a final response, never an intermediate response with an 1xx status code. Whether redirects or authentication challenges will be returned or handled automatically depends on the implementation and configuration of this client.
org.apache.hc.client5.http.classic.HttpClient.execute
(HttpHost
the target host for the request. Implementations may accept null if they can still determine a route, for example to a default target or by inspecting the request.
target
,
ClassicHttpRequest
the request to execute
request
,
HttpContext
the context to use for the execution, or null to use the default context
context
)

It is strongly recommended to use execute methods with HttpClientResponseHandler such as execute(HttpHost, ClassicHttpRequest, HttpContext, HttpClientResponseHandler) in order to ensure automatic resource deallocation by the client. For special cases one can still use executeOpen(HttpHost, ClassicHttpRequest, HttpContext) to keep the response object open after the request execution.

Returns:

true if the cookie has expired.
org.apache.hc.client5.http.cookie.Cookie.isExpired
(final Date
Current time
date
)

Use {isExpired(Instant)}

org.apache.hc.client5.http.cookie.SetCookie.setExpiryDate(Date
the Date after which this cookie is no longer valid.
expiryDate
)

Use {setExpiryDate(Instant)}

org.apache.hc.client5.http.impl.RequestCopier.INSTANCE

Deprecated as a consequence of RequestCopier being deprecated. See corresponding docs for further information.

org.apache.hc.client5.http.impl.async.HttpAsyncClientBuilder.tlsConfig

TLS should be configured by the connection manager

org.apache.hc.client5.http.impl.async.InternalHttpAsyncExecRuntime.tlsConfig

TLS should be configured by the connection manager

org.apache.hc.client5.http.impl.auth.GGSSchemeBase

Do not use. The GGS based experimental authentication schemes are no longer supported. Consider using Basic or Bearer authentication with TLS instead.

org.apache.hc.client5.http.impl.auth.GGSSchemeBase.GGSSchemeBase(final KerberosConfig config, final DnsResolver dnsResolver)

Deprecated as a consequence of KerberosConfig being deprecated. See corresponding docs for further information.

org.apache.hc.client5.http.impl.auth.GGSSchemeBase.GGSSchemeBase(final KerberosConfig config)

Deprecated as a consequence of KerberosConfig being deprecated. See corresponding docs for further information.

org.apache.hc.client5.http.impl.auth.GGSSchemeBase.config

Deprecated as a consequence of KerberosConfig being deprecated. See corresponding docs for further information.

org.apache.hc.client5.http.impl.auth.KerberosScheme

Do not use. The GGS based experimental authentication schemes are no longer supported. Consider using Basic or Bearer authentication with TLS instead.

org.apache.hc.client5.http.impl.auth.KerberosScheme.KerberosScheme(final KerberosConfig config, final DnsResolver dnsResolver)

Deprecated as a consequence of KerberosConfig being deprecated. See corresponding docs for further information.

org.apache.hc.client5.http.impl.auth.KerberosSchemeFactory

Do not use. The GGS based experimental authentication schemes are no longer supported. Consider using Basic or Bearer authentication with TLS instead.

org.apache.hc.client5.http.impl.auth.KerberosSchemeFactory.DEFAULT

Deprecated as a consequence of KerberosSchemeFactory being deprecated. See corresponding docs for further information.

org.apache.hc.client5.http.impl.auth.KerberosSchemeFactory.KerberosSchemeFactory(final KerberosConfig config, final DnsResolver dnsResolver)

Deprecated as a consequence of KerberosConfig being deprecated. See corresponding docs for further information.

org.apache.hc.client5.http.impl.auth.KerberosSchemeFactory.config

Deprecated as a consequence of KerberosConfig being deprecated. See corresponding docs for further information.

org.apache.hc.client5.http.impl.auth.NTLMEngine

Do not use. the NTLM authentication scheme is no longer supported

org.apache.hc.client5.http.impl.auth.NTLMScheme

Do not use. the NTLM authentication scheme is no longer supported. Consider using Basic or Bearer authentication with TLS instead.

org.apache.hc.client5.http.impl.auth.NTLMScheme.NTLMScheme(final NTLMEngine engine)

Deprecated as a consequence of NTLMEngine being deprecated. See corresponding docs for further information.

org.apache.hc.client5.http.impl.auth.NTLMScheme.credentials

Deprecated as a consequence of NTCredentials being deprecated. See corresponding docs for further information.

org.apache.hc.client5.http.impl.auth.NTLMScheme.engine

Deprecated as a consequence of NTLMEngine being deprecated. See corresponding docs for further information.

org.apache.hc.client5.http.impl.auth.NTLMSchemeFactory

Do not use. the NTLM authentication scheme is no longer supported. Consider using Basic or Bearer authentication with TLS instead.

org.apache.hc.client5.http.impl.auth.NTLMSchemeFactory.INSTANCE

Deprecated as a consequence of NTLMSchemeFactory being deprecated. See corresponding docs for further information.

org.apache.hc.client5.http.impl.auth.SPNegoScheme

Do not use. The GGS based experimental authentication schemes are no longer supported. Consider using Basic or Bearer authentication with TLS instead.

org.apache.hc.client5.http.impl.auth.SPNegoScheme.SPNegoScheme(final KerberosConfig config, final DnsResolver dnsResolver)

Deprecated as a consequence of KerberosConfig being deprecated. See corresponding docs for further information.

org.apache.hc.client5.http.impl.auth.SPNegoSchemeFactory

Do not use. The GGS based experimental authentication schemes are no longer supported. Consider using Basic or Bearer authentication with TLS instead.

org.apache.hc.client5.http.impl.auth.SPNegoSchemeFactory.DEFAULT

Deprecated as a consequence of SPNegoSchemeFactory being deprecated. See corresponding docs for further information.

org.apache.hc.client5.http.impl.auth.SPNegoSchemeFactory.SPNegoSchemeFactory(final KerberosConfig config, final DnsResolver dnsResolver)

Deprecated as a consequence of KerberosConfig being deprecated. See corresponding docs for further information.

org.apache.hc.client5.http.impl.auth.SPNegoSchemeFactory.config

Deprecated as a consequence of KerberosConfig being deprecated. See corresponding docs for further information.

org.apache.hc.client5.http.impl.classic.ClassicRequestCopier.INSTANCE

Deprecated as a consequence of ClassicRequestCopier being deprecated. See corresponding docs for further information.

org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(final HttpHost
the target host for the request. Implementations may accept null if they can still determine a route, for example to a default target or by inspecting the request.
target
,
final ClassicHttpRequest
the request to execute
request
,
final HttpContext
the context to use for the execution, or null to use the default context
context
)

It is strongly recommended to use execute methods with HttpClientResponseHandler such as execute(HttpHost, ClassicHttpRequest, HttpContext, HttpClientResponseHandler) in order to ensure automatic resource deallocation by the client. For special cases one can still use executeOpen(HttpHost, ClassicHttpRequest, HttpContext) to keep the response object open after the request execution.

org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(final ClassicHttpRequest
the request to execute
request
,
final HttpContext
the context to use for the execution, or null to use the default context
context
)

It is strongly recommended to use execute methods with HttpClientResponseHandler such as execute(ClassicHttpRequest, HttpContext, HttpClientResponseHandler) in order to ensure automatic resource deallocation by the client. For special cases one can still use executeOpen(HttpHost, ClassicHttpRequest, HttpContext) to keep the response object open after the request execution.

org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(final ClassicHttpRequest
the request to execute
request
)

It is strongly recommended to use execute methods with HttpClientResponseHandler such as execute(ClassicHttpRequest, HttpClientResponseHandler) in order to ensure automatic resource deallocation by the client. For special cases one can still use executeOpen(HttpHost, ClassicHttpRequest, HttpContext) to keep the response object open after the request execution.

org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(final HttpHost
the target host for the request. Implementations may accept null if they can still determine a route, for example to a default target or by inspecting the request.
target
,
final ClassicHttpRequest
the request to execute
request
)

It is strongly recommended to use execute methods with HttpClientResponseHandler such as execute(HttpHost, ClassicHttpRequest, HttpClientResponseHandler) in order to ensure automatic resource deallocation by the client. For special cases one can still use executeOpen(HttpHost, ClassicHttpRequest, HttpContext) to keep the response object open after the request execution.

Returns:

true if the cookie has expired.
org.apache.hc.client5.http.impl.cookie.BasicClientCookie.isExpired
(final Date
Current time
date
)

Use isExpired(Instant)

org.apache.hc.client5.http.impl.cookie.BasicClientCookie.setExpiryDate(final Date
the Date after which this cookie is no longer valid.
expiryDate
)

Use {setExpiryDate(Instant)}

org.apache.hc.client5.http.ssl.AbstractClientTlsStrategy.upgrade(final TransportSecurityLayer
the session layer
tlsSession
,
final HttpHost
the name of the opposite endpoint when given or null otherwise.
host
,
final SocketAddress
the address of the local endpoint.
localAddress
,
final SocketAddress
the address of the remote endpoint.
remoteAddress
,
final Object
arbitrary object passes to the TLS session initialization code.
attachment
,
final Timeout
the timeout to use while performing the TLS handshake; may be null.
handshakeTimeout
)

use upgrade(TransportSecurityLayer, NamedEndpoint, Object, Timeout, FutureCallback)

org.apache.hc.client5.http.ssl.TrustSelfSignedStrategy

For self-signed certificates prefer specifying a keystore containing the certificate when calling the org.apache.hc.core5.ssl.SSLContextBuilder loadTrustMaterial methods.

org.apache.hc.client5.http.ssl.TrustSelfSignedStrategy.INSTANCE

Deprecated as a consequence of TrustSelfSignedStrategy being deprecated. See corresponding docs for further information.

org.apache.hc.client5.http.utils.DateUtils.GMT

This attribute is no longer supported as a part of the public API.

Returns:

An RFC 1123 formatted date string.
org.apache.hc.client5.http.utils.DateUtils.formatDate
(final Date
The date to format.
date
)

Use formatStandardDate(Instant)

Returns:

A formatted date string.
org.apache.hc.client5.http.utils.DateUtils.formatDate
(final Date
The date to format.
date
,
final String
The pattern to use for formatting the date.
pattern
)

Use formatDate(Instant, DateTimeFormatter)

Returns:

true if both messages contain a header with the given name and the value of the header from the first message is newer that of the second message.
org.apache.hc.client5.http.utils.DateUtils.isAfter
(final MessageHeaders
the first message
message1
,
final MessageHeaders
the second message
message2
,
final String
header name
headerName
)

This method is no longer supported as a part of the public API.

Returns:

true if both messages contain a header with the given name and the value of the header from the first message is older that of the second message.
org.apache.hc.client5.http.utils.DateUtils.isBefore
(final MessageHeaders
the first message
message1
,
final MessageHeaders
the second message
message2
,
final String
header name
headerName
)

This method is no longer supported as a part of the public API.

Returns:

the parsed date or null if input could not be parsed
org.apache.hc.client5.http.utils.DateUtils.parseDate
(final String
the date value to parse
dateValue
)

Use parseStandardDate(String)

Returns:

the parsed date or null if input could not be parsed
org.apache.hc.client5.http.utils.DateUtils.parseDate
(final MessageHeaders
message headers
headers
,
final String
header name
headerName
)

Use parseStandardDate(MessageHeaders, String)

Returns:

the parsed date or null if input could not be parsed
org.apache.hc.client5.http.utils.DateUtils.parseDate
(final String
the date value to parse
dateValue
,
final String[]
the date/time formats to use
dateFormats
)

Use parseDate(String, DateTimeFormatter...)

Returns:

the parsed date or null if input could not be parsed
org.apache.hc.client5.http.utils.DateUtils.parseDate
(final String
the date value to parse
dateValue
,
final String[]
the date/time formats to use
dateFormats
,
final Date
During parsing, two digit years will be placed in the range startDate to startDate + 100 years. This value may be null. When null is given as a parameter, year 2000 will be used.
startDate
)

Use parseDate(String, DateTimeFormatter...)

org.apache.hc.client5.http.utils.URIUtils.rewriteURI(final URI
Contains the path, query and fragment to use.
uri
,
final HttpHost
Contains the scheme, host and port to use.
target
,
final boolean
True if the fragment should not be copied.
dropFragment
)

Use URIBuilder.