Skip to content

Instantly share code, notes, and snippets.

@TechWatching
Last active May 19, 2021 16:49
Show Gist options
  • Save TechWatching/a907d4bcc06fa98a60f2939a6a388ec6 to your computer and use it in GitHub Desktop.
Save TechWatching/a907d4bcc06fa98a60f2939a6a388ec6 to your computer and use it in GitHub Desktop.
public void ConfigureServices(IServiceCollectionservices)
{
services.AddMemoryCache();
services.AddHttpClient<IUserApiAuthenticationService, UserApiAuthenticationService>()
.ConfigureHttpClient(c => c.BaseAddress ="http://urltotheuserapi.com");
services.AddTransient<UserApiAuthenticationHandler>();
services.AddHttpClient<UserService, UserService>()
.ConfigureHttpClient(c => c.BaseAddress ="http://urltotheuserapi.com")
.AddHttpMessageHandler<UserApiAuthenticationHanler>();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment