HttpClientBuilder class
Fluent builder used to configure named HTTP clients.
Constructors
- HttpClientBuilder(ServiceCollection services, String name)
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- name → String
-
The logical name of the client.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- services → ServiceCollection
-
The service collection the client is registered with.
final
Methods
-
addHttpMessageHandler(
HttpMessageHandler handlerFactory(ServiceProvider services)) → HttpClientBuilder - Adds a delegating handler to the pipeline.
-
addTypedClient<
TClient extends Object> (TClient factory(BaseClient client, ServiceProvider services)) → HttpClientBuilder - Registers a typed client that depends on this named client.
-
configureHttpClient(
void configure(BaseClient client, ServiceProvider services)) → HttpClientBuilder - Adds an action to configure the outgoing client instance.
-
configureHttpMessageHandlerBuilder(
HttpMessageHandlerBuilderAction configure) → HttpClientBuilder - Adds a delegate to mutate the handler pipeline.
-
configurePrimaryHttpMessageHandler(
HttpMessageHandler factory(ServiceProvider services)) → HttpClientBuilder - Sets the primary handler for the client.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
redactLoggedHeaderNames(
List< String> headerNames) → HttpClientBuilder - Configures specific header names to be redacted in logs.
-
redactLoggedHeaders(
bool shouldRedact(String headerName)) → HttpClientBuilder - Configures the header redaction for this HTTP client.
-
setHandlerLifetime(
Duration lifetime) → HttpClientBuilder - Sets the handler lifetime for this HTTP client.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited