public static final class HttpClient.Builder extends Object implements AutoCloseable
Builder
for the HttpClient
class.
Instances of HttpClient.Builder
are created by calling HttpClient#newBuilder
.
Constructor and Description |
---|
Builder(HttpClient.Builder other) |
Modifier and Type | Method and Description |
---|---|
HttpClient |
build()
Returns an
HttpClient , based on the properties set on this builder. |
void |
close() |
HttpClient.Builder |
credentialProvider(ICredentialsProvider credentialsProvider)
Sets the
credentials provider used by the HttpClient . |
protected void |
finalize() |
HttpClient.Builder |
httpRequestOptions(HttpRequestOptions httpRequestOptions)
Sets the
HTTP request options to send with each HTTP request. |
HttpClient.Builder |
proxySelector(IProxySelector proxySelector)
Sets the
proxy selector used by the HttpClient . |
public Builder(@NotNull HttpClient.Builder other)
public void close()
close
in interface AutoCloseable
@NotNull public HttpClient build()
HttpClient
, based on the properties set on this builder.HttpClient
, based on the properties set on this builder.@NotNull public HttpClient.Builder credentialProvider(@Nullable ICredentialsProvider credentialsProvider)
credentials provider
used by the HttpClient
.
This parameter is optional. If not set, the credentials provider
is taken from the environment
.
credentialsProvider
- The credential provider to use.@NotNull public HttpClient.Builder proxySelector(@Nullable IProxySelector proxySelector)
proxy selector
used by the HttpClient
.
This parameter is optional. If not set, the proxy selector
is taken from the environment
.
proxySelector
- The proxy selector to use.@NotNull public HttpClient.Builder httpRequestOptions(@NotNull HttpRequestOptions httpRequestOptions)
HTTP request options
to send with each HTTP request.
This parameter is optional.
httpRequestOptions
- The http request options.