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
NovaRazorHttpClientFactory
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
Set authentication and host headers appropriatly
Declaration
public static void ApplyEndpoint(HttpRequestHeaders headers, CachedExternalApi endpoint)
Parameters
Exceptions
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