Jazyk

HttpMessageHandlerBuilder Třída

Definice

Abstrakce tvůrce pro konfiguraci HttpMessageHandler instancí.

public ref class HttpMessageHandlerBuilder abstract
public abstract class HttpMessageHandlerBuilder
type HttpMessageHandlerBuilder = class
Public MustInherit Class HttpMessageHandlerBuilder
Dědičnost
HttpMessageHandlerBuilder

Poznámky

Tato HttpMessageHandlerBuilder služba je zaregistrovaná v kolekci služeb jako přechodná služba. Volající by měli načíst novou instanci, aby se vytvořila každá HttpMessageHandler instance. Implementátory by měly očekávat, že každá instance bude použita jednou.

Konstruktory

Name Description
HttpMessageHandlerBuilder()

Inicializuje novou instanci HttpMessageHandlerBuilder třídy.

Vlastnosti

Name Description
AdditionalHandlers

Získá seznam dalších DelegatingHandler instancí používaných ke konfiguraci HttpClient kanálu.

Name

Získá nebo nastaví název vytvářené HttpClient položky.

PrimaryHandler

Získá nebo nastaví primární HttpMessageHandler.

Services

IServiceProvider Získá, který lze použít k řešení služeb z kontejneru injektáž závislostí.

Metody

Name Description
Build()

Vytvoří HttpMessageHandler.

CreateHandlerPipeline(HttpMessageHandler, IEnumerable<DelegatingHandler>)

Vytvoří instanci HttpMessageHandler zřetězeným additionalHandlers jedním za druhým na primaryHandler konci řetězce. Výsledný kanál je používán infrastrukturou IHttpClientFactory k vytváření HttpClient instancí s přizpůsobenými obslužnými rutinami zpráv. Výsledný kanál lze také získat přístup pomocí namísto IHttpMessageHandlerFactoryIHttpClientFactory.

Platí pro