NetWave 1.0.0

dotnet add package NetWave --version 1.0.0
                    
NuGet\Install-Package NetWave -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NetWave" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NetWave" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="NetWave" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add NetWave --version 1.0.0
                    
#r "nuget: NetWave, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package NetWave@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=NetWave&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=NetWave&version=1.0.0
                    
Install as a Cake Tool

NetWave

NetWave is a lightweight and powerful HTTP client library designed specifically for .NET 8 applications. It simplifies making HTTP requests and provides seamless integration with RESTful APIs. With NetWave, developers can perform GET and POST requests easily while benefiting from enhanced error handling, detailed logs, and user-friendly exceptions.


Features

  • Ease of Use: Intuitive and developer-friendly APIs, abstracting away the complexity of HTTP requests.
  • Compatibility: Optimized for .NET 8, leveraging the latest features and enhancements.
  • Performance: Built on top of HttpClient, ensuring high performance and low memory overhead.
  • Detailed Logs: Comprehensive logging for each request and response, making debugging easier.
  • Flexible Serialization: Out-of-the-box support for JSON serialization/deserialization using System.Text.Json.
  • Error Handling: Meaningful exceptions with detailed messages to quickly identify issues.

Installation

Install the package via NuGet:

dotnet add package NetWave

Usage

1- Perform GET Requests <br /> Fetch data from an API endpoint:

using NetWave;

var url = "https://jsonplaceholder.typicode.com/posts";
var result = await NetWave.GetAsync<dynamic[]>(url);

Console.WriteLine("GET Request Result:");
foreach (var item in result)
{
    Console.WriteLine($"ID: {item.id}, Title: {item.title}");
}

2- Perform POST Requests <br/> Send data to an API endpoint:

using NetWave;

var postUrl = "https://jsonplaceholder.typicode.com/posts";
var body = new { title = "foo", body = "bar", userId = 1 };

var postResult = await NetWave.PostAsync<dynamic, dynamic>(postUrl, body);

Console.WriteLine("POST Request Result:");
Console.WriteLine($"Created ID: {postResult.id}");

3- Handle Errors Gracefully <br/> NetWave automatically logs errors, but you can handle them explicitly if needed:

using NetWave;

try
{
    var url = "https://invalid.api.endpoint";
    var result = await NetWave.GetAsync<dynamic>(url);
    Console.WriteLine(result ?? "Request failed.");
}
catch (Exception ex)
{
    Console.WriteLine($"Error: {ex.Message}");
}

Why Choose NetWave?

  • Developer-Centric: Simplifies HTTP interactions, letting you focus on your application's logic.
  • Modern Features: Built to harness the power of .NET 8.
  • Reliable: Tested to ensure stability across various use cases.

License

This project is licensed under the MIT License.

Contact

For support or feedback, feel free to reach out via the GitHub Issues page. https://github.com/MustafaLotfyGhoneim/NetWave/issues

Product Compatible and additional computed target framework versions.
.NET 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 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 Framework net481 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
1.0.0 195 12/31/2024