<PackageReference Include="Microsoft.IdentityModel.Protocols" Version="8.16.0" />

Microsoft.IdentityModel.Protocols.HttpDocumentRetriever

Retrieves metadata information using HttpClient.
public const string ResponseContent = "response_content"

The key is used to add response content into Data.

public const string StatusCode = "status_code"

The key is used to add status code into Data.

public static bool DefaultSendAdditionalHeaderData { get; set; }

Gets or sets whether additional default headers are added to a HttpRequestMessage headers. Set to true by default.

public Version HttpVersion { get; set; }

If set, specifies the desired HTTP version to use for the requests. Otherwise, HttpClient.DefaultRequestVersion is used.

public HttpVersionPolicy? HttpVersionPolicy { get; set; }

If set, specifies the protocol version policy to use when sending HTTP requests. Otherwise, HttpClient.DefaultVersionPolicy is used.

public bool RequireHttps { get; set; }

Requires Https secure channel for sending requests.. This is turned ON by default for security reasons. It is RECOMMENDED that you do not allow retrieval from http addresses by default.

public bool SendAdditionalHeaderData { get; set; }

Gets or sets whether additional headers are added to a HttpRequestMessage headers

Initializes a new instance of the HttpDocumentRetriever class.

public HttpDocumentRetriever(HttpClient httpClient)

Initializes a new instance of the HttpDocumentRetriever class with a specified httpClient.

public Task<string> GetDocumentAsync(string address, CancellationToken cancel)

Returns a task which contains a string converted from remote document when completed, by using the provided address.