Search Results for

    Show / Hide Table of Contents

    Class NovaRazorHttpClientFactory

    A factory class providing pooled/cached HttpClients for external API endpoints. To be registered as a scoped instance in the DI container.

    Inheritance
    object
    NovaRazorHttpClientFactory
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Noxum.Nova.Razor.Model
    Assembly: Noxum.Nova.Razor.Model.dll
    Syntax
    public class NovaRazorHttpClientFactory

    Constructors

    NovaRazorHttpClientFactory(INovaExternalApiClients)

    A factory class providing pooled/cached HttpClients for external API endpoints. To be registered as a scoped instance in the DI container.

    Declaration
    public NovaRazorHttpClientFactory(INovaExternalApiClients externalApiClients)
    Parameters
    Type Name Description
    INovaExternalApiClients externalApiClients

    Methods

    ApplyEndpoint(HttpRequestHeaders, CachedExternalApi)

    Set authentication and host headers appropriatly

    Declaration
    public static void ApplyEndpoint(HttpRequestHeaders headers, CachedExternalApi endpoint)
    Parameters
    Type Name Description
    HttpRequestHeaders headers
    CachedExternalApi endpoint
    Exceptions
    Type Condition
    InvalidOperationException

    GetHttpClientAsync(CachedExternalApi)

    Create and return the appropriate, disposable HttpClient for the given external API. This will use cached handlers as far as possible.

    Declaration
    public Task<HttpClient> GetHttpClientAsync(CachedExternalApi externalApi)
    Parameters
    Type Name Description
    CachedExternalApi externalApi
    Returns
    Type Description
    Task<HttpClient>
    In this article
    Back to top Version 6.1.0.7rc