RestSharp.Extensions.DependencyInjection
114.0.1-alpha.0.4
Prefix Reserved
dotnet add package RestSharp.Extensions.DependencyInjection --version 114.0.1-alpha.0.4
NuGet\Install-Package RestSharp.Extensions.DependencyInjection -Version 114.0.1-alpha.0.4
<PackageReference Include="RestSharp.Extensions.DependencyInjection" Version="114.0.1-alpha.0.4" />
<PackageVersion Include="RestSharp.Extensions.DependencyInjection" Version="114.0.1-alpha.0.4" />
<PackageReference Include="RestSharp.Extensions.DependencyInjection" />
paket add RestSharp.Extensions.DependencyInjection --version 114.0.1-alpha.0.4
#r "nuget: RestSharp.Extensions.DependencyInjection, 114.0.1-alpha.0.4"
#:package RestSharp.Extensions.DependencyInjection@114.0.1-alpha.0.4
#addin nuget:?package=RestSharp.Extensions.DependencyInjection&version=114.0.1-alpha.0.4&prerelease
#tool nuget:?package=RestSharp.Extensions.DependencyInjection&version=114.0.1-alpha.0.4&prerelease
About
The RestSharp.Extensions.DependencyInjection library provides integration with Microsoft.Extensions.DependencyInjection components as well as integrates with IHttpClientFactory.
How to use
Use the extension method provided by the package to configure the client:
// Add a default client with no base URL, with default options
services.AddRestClient();
// Add a client with a base URL
services.AddRestClient(new Uri("https://example.com"));
// Add a client with a base URL and custom options
services.AddRestClient(options =>
{
options.BaseUrl = new Uri("https://example.com");
options.Timeout = TimeSpan.FromSeconds(30);
});
When the above registrations are used, the IRestClient interface can be injected into any class.
In addition, the package supports registering named clients:
services.AddRestClient("my-client", options =>
{
options.BaseUrl = new Uri("https://example.com");
options.Timeout = TimeSpan.FromSeconds(30);
});
When the above registrations are used, resolving the client instance should be done using the IRestClientFactory:
public class MyClass(IRestClientFactory restClientFactory)
{
IRestClient client = restClientFactory.CreateClient("my-client");
// Use the client in your code
}
| 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 is compatible. 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 is compatible. 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 is compatible. 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 is compatible. net472 was computed. net48 is compatible. 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. |
-
.NETFramework 4.7.1
- Microsoft.Extensions.Http (>= 10.0.0)
- RestSharp (>= 114.0.1-alpha.0.4)
-
.NETFramework 4.8
- Microsoft.Extensions.Http (>= 10.0.0)
- RestSharp (>= 114.0.1-alpha.0.4)
-
.NETStandard 2.0
- Microsoft.Extensions.Http (>= 10.0.0)
- RestSharp (>= 114.0.1-alpha.0.4)
-
net10.0
- Microsoft.Extensions.Http (>= 10.0.0)
- RestSharp (>= 114.0.1-alpha.0.4)
-
net8.0
- Microsoft.Extensions.Http (>= 10.0.0)
- RestSharp (>= 114.0.1-alpha.0.4)
-
net9.0
- Microsoft.Extensions.Http (>= 10.0.0)
- RestSharp (>= 114.0.1-alpha.0.4)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 114.0.1-alpha.0.4 | 53 | 6/2/2026 |
| 114.0.1-alpha.0.3 | 52 | 6/2/2026 |
| 114.0.1-alpha.0.2 | 47 | 6/2/2026 |
| 114.0.0 | 2,147 | 3/5/2026 |
| 113.1.0 | 2,143 | 1/12/2026 |