![]() |
VOOZH | about |
dotnet add package RestApiClientSharp --version 1.0.9
NuGet\Install-Package RestApiClientSharp -Version 1.0.9
<PackageReference Include="RestApiClientSharp" Version="1.0.9" />
<PackageVersion Include="RestApiClientSharp" Version="1.0.9" />Directory.Packages.props
<PackageReference Include="RestApiClientSharp" />Project file
paket add RestApiClientSharp --version 1.0.9
#r "nuget: RestApiClientSharp, 1.0.9"
#:package RestApiClientSharp@1.0.9
#addin nuget:?package=RestApiClientSharp&version=1.0.9Install as a Cake Addin
#tool nuget:?package=RestApiClientSharp&version=1.0.9Install as a Cake Tool
Is a common library for a REST API client solution.
If you want to support me, you can order over following affilate links (I'll get a small share from your purchase from the corresponding store).
(*) Affiliate link Thank you very much for supporting me!
Get the latest version from nuget.org<br>
👁 NuGet
👁 NuGet
public virtual async Task<IRestApiRequestRespone?> SendRestApiRequestAsync(...);
public virtual async Task<IRestApiRequestRespone?> SendMultipartFormDataFileRestApiRequestAsync(...);
public virtual async Task<byte[]?> DownloadFileFromUriAsync(...);
This function allows you to send a simple REST request to your REST-API-Server endpoint.
If succeeded, you can access the received string and byte[] as followed.
IRestApiRequestRespone.Result
IRestApiRequestRespone.RawBytes
This function allows you to send a multi form data REST request to your REST-API-Server endpoint.
If succeeded, you can access the received string and byte[], the same as with the SendRestApiRequestAsync() function.
This function allows you to download a file as byte[].
You just can inherit from the RestApiClient class to get access to all common REST functions of our client.
public partial class MyCustomRestClient : RestApiClient
{
#region Constructor
public MyCustomRestClient() : base()
{ }
public MyCustomRestClient(string apiKey, string tokenName = "token") : base(
new AuthenticationHeader() { Token = apiKey, Target = AuthenticationHeaderTarget.UrlSegment},
tokenName)
{ }
public MyCustomRestClient(string webAddress, string apiKey, string tokenName = "token") : base(
new AuthenticationHeader() { Token = apiKey, Target = AuthenticationHeaderTarget.UrlSegment },
tokenName, webAddress)
{ }
#endregion
}
Example of communication
public async Task<StockQuoteResult?> GetStockQuoteAsync(string symbol)
{
IRestApiRequestRespone? result = null;
StockQuoteResult? resultObject = null;
Dictionary<string, string> parameters = [];
try
{
if (!string.IsNullOrEmpty(symbol)) parameters.Add("symbol", symbol);
string targetUri = $"";
result = await SendRestApiRequestAsync(
requestTargetUri: targetUri,
method: Method.Get,
command: "quote",
jsonObject: null,
authHeaders: AuthHeaders,
// Parameters
urlSegments: parameters,
cts: default
)
.ConfigureAwait(false);
resultObject = GetObjectFromJson<StockQuoteResult>(result?.Result, NewtonsoftJsonSerializerSettings);
return resultObject;
}
catch (Exception exc)
{
OnError(new UnhandledExceptionEventArgs(exc, false));
return resultObject;
}
}
You will find some complete, production examples here:
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 netstandard2.1 is compatible. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 2 NuGet packages that depend on RestApiClientSharp:
| Package | Downloads |
|---|---|
|
Print3dServer.Core
A C# based core library for our 3d Print Server nugets (Moonraker, Repetier Server, OctoPrint and so on). |
|
|
LexOfficeSharpApi
A simple library to make REST-API calls to the LexOffice public API. |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.9 | 98 | 6/12/2026 |
| 1.0.8 | 125 | 4/28/2026 |
| 1.0.7 | 193 | 12/5/2025 |
| 1.0.7-preview3 | 593 | 11/18/2025 |
| 1.0.7-preview2 | 327 | 11/12/2025 |
| 1.0.7-preview1 | 274 | 11/10/2025 |
| 1.0.7-preview | 257 | 11/6/2025 |
| 1.0.6 | 249 | 6/16/2025 |
| 1.0.5 | 880 | 4/11/2025 |
| 1.0.4 | 522 | 3/25/2025 |
| 1.0.3.1 | 222 | 1/30/2025 |
| 1.0.3 | 148 | 1/30/2025 |
| 1.0.2 | 150 | 1/27/2025 |
| 1.0.1 | 665 | 1/21/2025 |
| 1.0.0 | 158 | 12/19/2024 |
Check GitHub releases for changelog.