Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
class Microsoft.​Extensions.​Http.​HttpMessageHandlerBuilder
Assembly: Microsoft.Extensions.Http
Inheritance: object → HttpMessageHandlerBuilder
A builder abstraction for configuring <see cref="T:System.Net.Http.HttpMessageHandler" /> instances.
Remarks
The <see cref="T:Microsoft.Extensions.Http.HttpMessageHandlerBuilder" /> is registered in the service collection as
a transient service. Callers should retrieve a new instance for each <see cref="T:System.Net.Http.HttpMessageHandler" /> to
be created. Implementors should expect each instance to be used a single time.
Properties
public
System.​Collections.​Generic.​IList<​System.​Net.​Http.​DelegatingHandler>
AdditionalHandlers
Gets a list of additional <see cref="T:System.Net.Http.DelegatingHandler" /> instances used to configure an
<see cref="T:System.Net.Http.HttpClient" /> pipeline.
public
string
Name
Gets or sets the name of the <see cref="T:System.Net.Http.HttpClient" /> being created.
Remarks The <see cref="P:Microsoft.Extensions.Http.HttpMessageHandlerBuilder.Name" /> is set by the <see cref="T:System.Net.Http.IHttpClientFactory" /> infrastructure
and is public for unit testing purposes only. Setting the <see cref="P:Microsoft.Extensions.Http.HttpMessageHandlerBuilder.Name" /> outside of
testing scenarios may have unpredictable results.
PrimaryHandler
Gets or sets the primary <see cref="T:System.Net.Http.HttpMessageHandler" /> .
Services
Gets an <see cref="T:System.IServiceProvider" /> which can be used to resolve services
from the dependency injection container.
Remarks This property is sensitive to the value of
<see cref="P:Microsoft.Extensions.Http.HttpClientFactoryOptions.SuppressHandlerScope" /> . If <c>true</c> this
property will be a reference to the application's root service provider. If <c>false</c>
(default) this will be a reference to a scoped service provider that has the same
lifetime as the handler being created.
Methods
Build​()
Creates an <see cref="T:System.Net.Http.HttpMessageHandler" /> .
Returns An <see cref="T:System.Net.Http.HttpMessageHandler" /> built from the <see cref="P:Microsoft.Extensions.Http.HttpMessageHandlerBuilder.PrimaryHandler" /> and
<see cref="P:Microsoft.Extensions.Http.HttpMessageHandlerBuilder.AdditionalHandlers" /> .
public
bool
Equals​(object obj)
Inherited from object
protected
void
Finalize​()
Inherited from object
public
int
GetHashCode​()
Inherited from object
protected
object
MemberwiseClone​()
Inherited from object
public
string
ToString​()
Inherited from object