![]() |
VOOZH | about |
dotnet add package SweetMeSoft.Connectivity --version 1.10.130
NuGet\Install-Package SweetMeSoft.Connectivity -Version 1.10.130
<PackageReference Include="SweetMeSoft.Connectivity" Version="1.10.130" />
<PackageVersion Include="SweetMeSoft.Connectivity" Version="1.10.130" />Directory.Packages.props
<PackageReference Include="SweetMeSoft.Connectivity" />Project file
paket add SweetMeSoft.Connectivity --version 1.10.130
#r "nuget: SweetMeSoft.Connectivity, 1.10.130"
#:package SweetMeSoft.Connectivity@1.10.130
#addin nuget:?package=SweetMeSoft.Connectivity&version=1.10.130Install as a Cake Addin
#tool nuget:?package=SweetMeSoft.Connectivity&version=1.10.130Install as a Cake Tool
Library to simplify and standardize requests to APIs and web services.
SweetMeSoft.Connectivity is a library for .NET Standard 2.1 that provides an ApiReq class as a wrapper over HttpClient. Its goal is to facilitate making HTTP requests (GET, POST, PUT, DELETE), handling different content types, cookie management and response deserialization in a structured and reusable way.
HttpClient into a simpler API.GET, POST, PUT and DELETE.application/json, application/x-www-form-urlencoded and multipart/form-data.GenericReq<T> for requests and GenericRes<T> for responses, allowing strong typing.DownloadFile method to get files as a StreamFile.ApiReq.Instance for easy access.dotnet add package SweetMeSoft.Connectivity
The library is used through the singleton instance ApiReq.Instance.
GenericReq<T>: The RequestThis object is used to configure all request details.
| Property | Type | Description |
|---|---|---|
Url |
string |
Required. The endpoint URL. |
Data |
T |
The object with data to send in the request body (for POST and PUT). |
HeaderType |
HeaderType |
The content type (json, xwwwunlercoded, formdata). |
Authentication |
Authentication |
Object to configure authentication (e.g. Bearer Token). |
Cookies |
string |
Cookies to send in the request. |
Headers |
HttpHeaders |
Additional HTTP headers. |
AdditionalParams |
List<KeyValuePair<string, string>> |
Additional parameters for xwwwunlercoded. |
GenericRes<T>: The ResponseThis object contains the request result.
| Property | Type | Description |
|---|---|---|
Object |
T |
The deserialized response object (if the request was successful). |
HttpResponse |
HttpResponseMessage |
The original HTTP response. |
Error |
ErrorDetails |
Error details (if the request failed). |
Cookies |
string |
The cookies received in the response. |
IsSuccess |
bool |
Indicates if the request was successful (true/false). |
// Define the expected response model
public class User
{
public int Id { get; set; }
public string Name { get; set; }
}
// Make the request
var response = await ApiReq.Instance.Get<User>("https://api.example.com/users/1");
if (response.IsSuccess)
{
User user = response.Object;
// ... use the 'user' object
}
else
{
// ... handle the error with response.Error
}
// Define the request model
public class CreateUserInput
{
public string Name { get; set; }
public string Email { get; set; }
}
// Define the response model
public class CreateUserOutput
{
public int Id { get; set; }
public string CreatedAt { get; set; }
}
// Prepare the request
var requestData = new CreateUserInput { Name = "John Doe", Email = "john.doe@example.com" };
var request = new GenericReq<CreateUserInput>
{
Url = "https://api.example.com/users",
Data = requestData,
HeaderType = HeaderType.json // or xwwwunlercoded, formdata
};
// Make the request
var response = await ApiReq.Instance.Post<CreateUserInput, CreateUserOutput>(request);
if (response.IsSuccess)
{
CreateUserOutput newUser = response.Object;
// ...
}
This project is under the MIT license.
| 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 was computed. 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 was computed. 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 was computed. 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 SweetMeSoft.Connectivity:
| Package | Downloads |
|---|---|
|
SweetMeSoft.Mobile.Base
SweetMeSoft Mobile MAUI Base Library is a compilation of different utils for MAUI apps |
|
|
SweetMeSoft.Uno.Base
SweetMeSoft Uno Base Library is a compilation of different utils for UNO Platform apps |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.10.130 | 248 | 2/19/2026 |
| 1.10.129 | 531 | 9/17/2025 |
| 1.10.128 | 573 | 2/20/2025 |
| 1.10.127 | 269 | 1/30/2025 |
| 1.10.126 | 351 | 8/22/2024 |
| 1.10.125 | 285 | 7/23/2024 |
| 1.10.124 | 319 | 7/23/2024 |
| 1.10.123 | 277 | 7/19/2024 |
| 1.10.122 | 370 | 5/20/2024 |
| 1.10.121 | 512 | 3/2/2024 |
| 1.10.120 | 302 | 2/12/2024 |
| 1.10.119 | 296 | 2/8/2024 |
| 1.10.118 | 331 | 11/23/2023 |
| 1.10.116 | 253 | 11/3/2023 |
| 1.10.115 | 271 | 9/14/2023 |
| 1.10.114 | 299 | 8/25/2023 |
| 1.10.113 | 309 | 8/23/2023 |
| 1.10.112 | 259 | 8/22/2023 |