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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Returns anHttpClient, based on the properties set on this builder.voidclose()credentialProvider(ICredentialsProvider credentialsProvider) Sets thecredentials providerused by theHttpClient.protected voidfinalize()httpRequestOptions(HttpRequestOptions httpRequestOptions) Sets theHTTP request optionsto send with each HTTP request.proxySelector(IProxySelector proxySelector) Sets theproxy selectorused by theHttpClient.
-
Constructor Details
-
Builder
-
-
Method Details
-
finalize
protected void finalize() -
close
public void close()- Specified by:
closein 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 providerused by theHttpClient.This parameter is optional. If not set, the
credentials provideris taken from theenvironment.- Parameters:
credentialsProvider- The credential provider to use.- Returns:
- this builder.
-
proxySelector
Sets theproxy selectorused by theHttpClient.This parameter is optional. If not set, the
proxy selectoris 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 optionsto send with each HTTP request.This parameter is optional.
- Parameters:
httpRequestOptions- The http request options.- Returns:
- this builder.
-