diff --git a/samples/StandaloneApp/Pages/FetchData.cshtml b/samples/StandaloneApp/Pages/FetchData.cshtml
index 2cc8cbfcb6..ef6efd2958 100644
--- a/samples/StandaloneApp/Pages/FetchData.cshtml
+++ b/samples/StandaloneApp/Pages/FetchData.cshtml
@@ -1,5 +1,4 @@
-@using Microsoft.AspNetCore.Blazor.Browser.Services.Temporary
-@inject HttpClient Http
+@inject HttpClient Http
Weather forecast
diff --git a/samples/StandaloneApp/_ViewImports.cshtml b/samples/StandaloneApp/_ViewImports.cshtml
index caea86a11a..eae35968c9 100644
--- a/samples/StandaloneApp/_ViewImports.cshtml
+++ b/samples/StandaloneApp/_ViewImports.cshtml
@@ -1,4 +1,5 @@
-@using Microsoft.AspNetCore.Blazor
+@using System.Net.Http
+@using Microsoft.AspNetCore.Blazor
@using Microsoft.AspNetCore.Blazor.Layouts
@using Microsoft.AspNetCore.Blazor.Routing
@using StandaloneApp
diff --git a/src/Microsoft.AspNetCore.Blazor.Browser.JS/src/Services/Http.ts b/src/Microsoft.AspNetCore.Blazor.Browser.JS/src/Services/Http.ts
index 26b68c7166..170761646f 100644
--- a/src/Microsoft.AspNetCore.Blazor.Browser.JS/src/Services/Http.ts
+++ b/src/Microsoft.AspNetCore.Blazor.Browser.JS/src/Services/Http.ts
@@ -2,8 +2,8 @@
import { platform } from '../Environment';
import { MethodHandle, System_String } from '../Platform/Platform';
const httpClientAssembly = 'Microsoft.AspNetCore.Blazor.Browser';
-const httpClientNamespace = `${httpClientAssembly}.Services.Temporary`;
-const httpClientTypeName = 'HttpClient';
+const httpClientNamespace = `${httpClientAssembly}.Http`;
+const httpClientTypeName = 'BrowserHttpMessageHandler';
const httpClientFullTypeName = `${httpClientNamespace}.${httpClientTypeName}`;
let receiveResponseMethod: MethodHandle;
diff --git a/src/Microsoft.AspNetCore.Blazor.Browser/Http/BrowserHttpMessageHandler.cs b/src/Microsoft.AspNetCore.Blazor.Browser/Http/BrowserHttpMessageHandler.cs
new file mode 100644
index 0000000000..de00e0a3a5
--- /dev/null
+++ b/src/Microsoft.AspNetCore.Blazor.Browser/Http/BrowserHttpMessageHandler.cs
@@ -0,0 +1,117 @@
+// Copyright (c) .NET Foundation. All rights reserved.
+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using Microsoft.AspNetCore.Blazor.Browser.Interop;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Net.Http;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace Microsoft.AspNetCore.Blazor.Browser.Http
+{
+ ///
+ /// A browser-compatible implementation of
+ ///
+ public class BrowserHttpMessageHandler : HttpMessageHandler
+ {
+ static object _idLock = new object();
+ static int _nextRequestId = 0;
+ static IDictionary> _pendingRequests
+ = new Dictionary>();
+
+ ///
+ protected override async Task SendAsync(
+ HttpRequestMessage request, CancellationToken cancellationToken)
+ {
+ var tcs = new TaskCompletionSource();
+ cancellationToken.Register(() => tcs.TrySetCanceled());
+
+ int id;
+ lock (_idLock)
+ {
+ id = _nextRequestId++;
+ _pendingRequests.Add(id, tcs);
+ }
+
+ RegisteredFunction.Invoke