Package com.luciad.net.http
Class HttpClient.Builder
java.lang.Object
com.luciad.net.http.HttpClient.Builder
- All Implemented Interfaces:
AutoCloseable
- Enclosing class:
HttpClient
Builder
for the HttpClient
class.
Instances of HttpClient.Builder
are created by calling HttpClient#newBuilder
.
- Since:
- 2023.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Returns anHttpClient
, based on the properties set on this builder.void
close()
credentialProvider
(ICredentialsProvider credentialsProvider) Sets thecredentials provider
used by theHttpClient
.protected void
finalize()
httpRequestOptions
(HttpRequestOptions httpRequestOptions) Sets theHTTP request options
to send with each HTTP request.proxySelector
(IProxySelector proxySelector) Sets theproxy selector
used by theHttpClient
.
-
Constructor Details
-
Method Details
-
finalize
protected void finalize() -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
build
Returns anHttpClient
, based on the properties set on this builder.- Returns:
- an
HttpClient
, based on the properties set on this builder.
-
credentialProvider
@NotNull public HttpClient.Builder credentialProvider(@Nullable ICredentialsProvider credentialsProvider) Sets thecredentials provider
used by theHttpClient
.This parameter is optional. If not set, the
credentials provider
is taken from theenvironment
.- Parameters:
credentialsProvider
- The credential provider to use.- Returns:
- this builder.
-
proxySelector
Sets theproxy selector
used by theHttpClient
.This parameter is optional. If not set, the
proxy selector
is taken from theenvironment
.- Parameters:
proxySelector
- The proxy selector to use.- Returns:
- this builder.
-
httpRequestOptions
@NotNull public HttpClient.Builder httpRequestOptions(@NotNull HttpRequestOptions httpRequestOptions) Sets theHTTP request options
to send with each HTTP request.This parameter is optional.
- Parameters:
httpRequestOptions
- The http request options.- Returns:
- this builder.
-