Toolbelt.Blazor.HttpClientInterceptor
4.0.0.3
See the version list below for details.
dotnet add package Toolbelt.Blazor.HttpClientInterceptor --version 4.0.0.3
NuGet\Install-Package Toolbelt.Blazor.HttpClientInterceptor -Version 4.0.0.3
<PackageReference Include="Toolbelt.Blazor.HttpClientInterceptor" Version="4.0.0.3" />
<PackageVersion Include="Toolbelt.Blazor.HttpClientInterceptor" Version="4.0.0.3" />
<PackageReference Include="Toolbelt.Blazor.HttpClientInterceptor" />
paket add Toolbelt.Blazor.HttpClientInterceptor --version 4.0.0.3
#r "nuget: Toolbelt.Blazor.HttpClientInterceptor, 4.0.0.3"
#:package Toolbelt.Blazor.HttpClientInterceptor@4.0.0.3
#addin nuget:?package=Toolbelt.Blazor.HttpClientInterceptor&version=4.0.0.3
#tool nuget:?package=Toolbelt.Blazor.HttpClientInterceptor&version=4.0.0.3
Blazor (client-side) HttpClient Interceptor 
Summary
The class library that intercept all of the sending HTTP requests on a client side Blazor application.
How to install and use?
Step.1 Install the library via NuGet package, like this.
> dotnet add package Toolbelt.Blazor.HttpClientInterceptor
Step.2 Register "HttpClientInterceptor" service into the DI container, at ConfigureService method in the Startup class of your Blazor application.
using Toolbelt.Blazor.Extensions.DependencyInjection; // <- Add this, and...
...
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddHttpClientInterceptor(); // <- Add this line.
...
Step.3 Install "HttpClientInterceptor" service to intercepting works well, at Configure method in the Startup class of your Blazor application.
public void Configure(IComponentsApplicationBuilder app)
{
app.UseHttpClientInterceptor(); // <- Add this line.
...
That's all.
You can subscribe the events that will occur before/after sending all of the HTTP requests, at anywhere you can get HttpClientInterceptor service from the DI container.
@using Toolbelt.Blazor
@inject HttpClientInterceptor Interceptor
...
@functions {
protected override void OnInit()
{
this.Interceptor.BeforeSend += Interceptor_BeforeSend;
...
}
void Interceptor_BeforeSend(object sender, EventArgs e)
{
// Do something here what you want to do.
}
...
Note: Please remember that if you use
HttpClientInterceptorto subscribeBeforeSend/AfterSendevents in Blazor components (.razor), you should unsubscribe events when the components is discarded. To do it, you should implementIDisposableinterface in that component, like this code:
@implements IDisposable
...
public void Dispose()
{
this.Interceptor.BeforeSend -= Interceptor_BeforeSend;
}
Release Note
- v.4.0.0 - BREAKING CHANGE: Support Blazor v.3.0.0 Preview 4 (not compatible with v.0.9.0 or before.)
- v.3.0.0 - BREAKING CHANGE: Support Blazor v.0.8.0 (not compatible with v.0.7.0 or before.)
- v.2.1.0 - Support Blazor v.0.6.0 - it was signed strong name.
- v.2.0.0 - BREAKING CHANGE: Fix namespace of HttpClientInterceptorExtension class.
- v.1.0.0 - 1st release.
License
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Microsoft.AspNetCore.Blazor (>= 3.0.0-preview4-19216-03)
NuGet packages (12)
Showing the top 5 NuGet packages that depend on Toolbelt.Blazor.HttpClientInterceptor:
| Package | Downloads |
|---|---|
|
Toolbelt.Blazor.LoadingBar
Insert loading bar UI automatically into a Blazor WebAssembly app. |
|
|
SunnyMehr.P1.HttpClient
Package Description |
|
|
M5x.MudBlazor
Package Description |
|
|
SoftwareDriven.OpenIdConnect.Client
SoftwareDriven.OpenIdConnect.Client is a library to provide client side services to use the OIDC protocol. |
|
|
mdimai666.Blast.AppFront.Shared
Shared project using Blast client apps |
GitHub repositories (2)
Showing the top 2 popular GitHub repositories that depend on Toolbelt.Blazor.HttpClientInterceptor:
| Repository | Stars |
|---|---|
|
fullstackhero/blazor-starter-kit
Clean Architecture Template for Blazor WebAssembly Built with MudBlazor Components.
|
|
|
jsakamoto/Toolbelt.Blazor.LoadingBar
Loading bar UI for Client-Side Blazor application.
|
| Version | Downloads | Last Updated |
|---|---|---|
| 10.2.0 | 599,776 | 9/29/2022 |
| 10.1.0 | 160,209 | 2/18/2022 |
| 10.0.0 | 282,084 | 8/21/2021 |
| 9.2.1 | 111,826 | 11/10/2020 |
| 9.2.0-preview.1 | 1,237 | 9/26/2020 |
| 9.1.0 | 4,958 | 9/11/2020 |
| 9.1.0-preview.1 | 415 | 9/9/2020 |
| 9.0.1 | 60,600 | 7/22/2020 |
| 9.0.0 | 10,316 | 4/25/2020 |
| 8.0.1 | 4,976 | 3/12/2020 |
| 8.0.0 | 526 | 3/11/2020 |
| 7.0.0 | 11,896 | 1/29/2020 |
| 6.1.0 | 617 | 1/24/2020 |
| 6.0.0 | 3,968 | 11/20/2019 |
| 5.0.0 | 4,256 | 6/14/2019 |
| 4.0.0.3 | 1,663 | 4/26/2019 |
| 3.0.0 | 2,106 | 2/8/2019 |
| 2.1.0 | 2,268 | 10/3/2018 |
| 2.0.0 | 1,669 | 9/21/2018 |
| 1.0.0 | 2,315 | 9/14/2018 |
v.4.0.0
- BREAKING CHANGE: Support Blazor v.3.0.0 Preview 4 (not compatible with v.0.9.0 or before.)
v.3.0.0
- BREAKING CHANGE: Support Blazor v.0.8.0 (not compatible with v.0.7.0 or before.)
v.2.1.0
- Support Blazor v.0.6.0 - it was signed strong name.
v.2.0.0
- BREAKING CHANGE: Fix namespace of HttpClientInterceptorExtension class.
v.1.0.0
- 1st release.