Arbus.Network 2.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Arbus.Network --version 2.0.0
NuGet\Install-Package Arbus.Network -Version 2.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="Arbus.Network" Version="2.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Arbus.Network --version 2.0.0
#r "nuget: Arbus.Network, 2.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.
// Install Arbus.Network as a Cake Addin
#addin nuget:?package=Arbus.Network&version=2.0.0

// Install Arbus.Network as a Cake Tool
#tool nuget:?package=Arbus.Network&version=2.0.0

Arbus.Network

Build Status

Working with an HttpClient in C# could be quite tricky as for new and as for experienced software developers. Network code usually appears to be duplicated in multiple projects. Such code is hard to maintain and improve.
At Arbus, we are excited to share the network code we've been working on for more than two years. We wanted to write network code that'll be possible to reuse in wide range of solutions. There're two principles of software development we mostly kept in our minds: DRY and Single-responsibility principles. We believe an Open Source community will attract passionate developers like us. Everyone is welcome to contribute.

Let's build a better world together!

Features

  • ApiEndpoints is the perfect place for request/response pair details.
  • HttpTimeout handling.
  • Built-in JSON support.
  • ProblemDetails format support for non-success responses.
  • Built-in NetworkExceptions.
  • Highly customizable for different needs

How to use

  1. Provide your own implementation or use default one for interfaces: INetworkManager, INativeHttpClient, IDefaultHttpClient, IHttpClientContext:

    _networkManager = new WindowsNetworkManager();
    _nativeHttpClient = new WindowsHttpClient();
    _defaulHttpClient = new DefaultHttpClient(_nativeHttpClient, _networkManager);
    _httpClientContext = new HttpClientContext(_defaulHttpClient);
    
    
  2. Use ApiEndpoint as base class for your API endpoints:

    public class GetAllOrdersApiEndpoint : ApiEndpoint<OrdersResponseDto>
    {
        public override string Path => "https://example.com/api/v1/orders";
        public override HttpMethod Method => HttpMethod.Get;
    }
    
  3. Run your endpoint:

    GetAllOrdersApiEndpoint endpoint = new();
    var orders = await _httpClientContext.RunEndpoint(endpoint).ConfigureAwait(false);
    

Take a look at samples in the repo's root.

Downloads

The latest stable release of Arbus.Network is available on NuGet.

Product 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. 
.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. 
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
8.0.0 1,101 7/6/2023
7.0.0 211 6/15/2023
6.0.0 181 6/13/2023
5.1.2 167 6/9/2023
5.1.1 154 6/8/2023
5.1.0 144 6/7/2023
5.0.3 135 6/7/2023
5.0.2 139 6/7/2023
5.0.1 152 6/6/2023
5.0.0 130 6/1/2023
4.0.0 1,224 11/15/2022
3.0.1 419 11/7/2022
3.0.0.3 449 10/13/2022
3.0.0 442 10/12/2022
2.1.0 393 10/6/2022
2.0.1 762 7/25/2022
2.0.0 462 7/7/2022
1.2.2 422 7/5/2022