From f6730f65c4cb2a241ce0c0452b7182a1332c0f06 Mon Sep 17 00:00:00 2001 From: johndhunter Date: Tue, 26 Oct 2021 17:42:37 +0100 Subject: [PATCH] Update additional-scenarios.md (#23650) --- .../blazor/security/webassembly/additional-scenarios.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aspnetcore/blazor/security/webassembly/additional-scenarios.md b/aspnetcore/blazor/security/webassembly/additional-scenarios.md index b4359e9980..25befb4eb6 100644 --- a/aspnetcore/blazor/security/webassembly/additional-scenarios.md +++ b/aspnetcore/blazor/security/webassembly/additional-scenarios.md @@ -34,6 +34,7 @@ using Microsoft.AspNetCore.Components.WebAssembly.Authentication; ... +// AddHttpClient is an extension in Microsoft.Http.Extensions builder.Services.AddHttpClient("WebAPI", client => client.BaseAddress = new Uri("https://www.example.com/base")) .AddHttpMessageHandler(); @@ -98,6 +99,7 @@ In `Program.cs`, `CustomAuthorizationMessageHandler` is registered as a scoped s ```csharp builder.Services.AddScoped(); +// AddHttpClient is an extension in Microsoft.Http.Extensions builder.Services.AddHttpClient("WebAPI", client => client.BaseAddress = new Uri("https://www.example.com/base")) .AddHttpMessageHandler(); @@ -210,6 +212,7 @@ using Microsoft.AspNetCore.Components.WebAssembly.Authentication; ... +// AddHttpClient is an extension in Microsoft.Http.Extensions builder.Services.AddHttpClient( client => client.BaseAddress = new Uri("https://www.example.com/base")) .AddHttpMessageHandler(); @@ -237,6 +240,7 @@ The handler can be further configured with ( client => client.BaseAddress = new Uri("https://www.example.com/base")) .AddHttpMessageHandler(sp => sp.GetRequiredService() @@ -257,6 +261,7 @@ If the Blazor WebAssembly app ordinarily uses a secure default client.BaseAddress = new Uri("https://www.example.com/base")); ```