VOOZH about

URL: https://www.nuget.org/packages/DoenaSoft.AbstractionLayer.Web/

⇱ NuGet Gallery | DoenaSoft.AbstractionLayer.Web 3.0.0




👁 Image
DoenaSoft.AbstractionLayer.Web 3.0.0

dotnet add package DoenaSoft.AbstractionLayer.Web --version 3.0.0
 
 
NuGet\Install-Package DoenaSoft.AbstractionLayer.Web -Version 3.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="DoenaSoft.AbstractionLayer.Web" Version="3.0.0" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DoenaSoft.AbstractionLayer.Web" Version="3.0.0" />
 
Directory.Packages.props
<PackageReference Include="DoenaSoft.AbstractionLayer.Web" />
 
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 DoenaSoft.AbstractionLayer.Web --version 3.0.0
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: DoenaSoft.AbstractionLayer.Web, 3.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 DoenaSoft.AbstractionLayer.Web@3.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=DoenaSoft.AbstractionLayer.Web&version=3.0.0
 
Install as a Cake Addin
#tool nuget:?package=DoenaSoft.AbstractionLayer.Web&version=3.0.0
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

DoenaSoft.AbstractionLayer.Web

Web and HTTP interface contracts for abstraction layer. This project contains interface definitions only and targets .NET Standard 2.0, .NET Framework 4.7.2, and .NET 10 to be usable from multiple framework versions.

Package Id: DoenaSoft.AbstractionLayer.Web

Targets: netstandard2.0, net472, net10.0

Overview

This package contains only the interface contracts for web and HTTP abstractions. For production use, you'll also need the default implementations package: DoenaSoft.AbstractionLayer.Web.Default which contains System.Net-based implementations of these interfaces.

License: MIT

Interfaces

The project provides the following interfaces for web operations:

Core Interface

  • IWebServices - The main entry point for creating web clients and requests. Provides factory methods:
    • CreateWebRequest(string targetUrl, IWebProxy proxy, CultureInfo ci) - Creates a web request
    • CreateWebClient(IWebProxy proxy) - Creates a web client

Web Operation Interfaces

  • IWebClient - Abstraction for System.Net.WebClient. Provides methods for downloading data, strings, and files.
  • IWebRequest - Abstraction for System.Net.WebRequest. Provides methods for creating and configuring HTTP requests.
  • IWebResponse - Abstraction for System.Net.WebResponse. Provides methods for reading HTTP responses.

Usage

In Production Code

Program against these interfaces and inject implementations at runtime. For the default System.Net-based implementations, reference the DoenaSoft.AbstractionLayer.Web.Default package:

using DoenaSoft.AbstractionLayer.WebServices;

public class ApiClient
{
 private readonly IWebServices _webServices;

 public ApiClient(IWebServices webServices)
 {
 _webServices = webServices;
 }

 public string GetData(string url)
 {
 using var client = _webServices.CreateWebClient();
 return client.DownloadString(url);
 }
}

// In your application startup (using DoenaSoft.AbstractionLayer.Web.Default):
var webServices = new WebServices();
var apiClient = new ApiClient(webServices);

In Unit Tests

Reference only this contracts package and provide test doubles to avoid network I/O:

class FakeWebClient : IWebClient
{
 public string DownloadString(string url) => "{\"result\":\"test data\"}";
 // ... implement other members as needed
}

class FakeWebServices : IWebServices
{
 public IWebRequest CreateWebRequest(string targetUrl, IWebProxy proxy = null, CultureInfo ci = null)
 => throw new NotImplementedException();

 public IWebClient CreateWebClient(IWebProxy proxy = null)
 => new FakeWebClient();
}

// In your test
var fake = new FakeWebServices();
var apiClient = new ApiClient(fake);
var data = apiClient.GetData("https://api.example.com/data");
Assert.AreEqual("{\"result\":\"test data\"}", data);

Testing Benefits

  • Replace real network operations with in-memory fakes during tests to avoid network I/O
  • Set up deterministic responses for tests
  • Verify that your code handles network errors (timeouts, 404s, 500s) without making actual network calls
  • Test retry logic and error handling without relying on external services
  • Keep test projects lightweight by referencing only the contracts package

Package Architecture

  • DoenaSoft.AbstractionLayer.Web (this package) - Interface contracts only
  • DoenaSoft.AbstractionLayer.Web.Default - Default System.Net-based implementations (depends on this package)

For production use, reference DoenaSoft.AbstractionLayer.Web.Default. For unit tests, reference only this contracts package.

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 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 netcoreapp2.0 netcoreapp2.0 was computed.  netcoreapp2.1 netcoreapp2.1 was computed.  netcoreapp2.2 netcoreapp2.2 was computed.  netcoreapp3.0 netcoreapp3.0 was computed.  netcoreapp3.1 netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 netstandard2.0 is compatible.  netstandard2.1 netstandard2.1 was computed. 
.NET Framework net461 net461 was computed.  net462 net462 was computed.  net463 net463 was computed.  net47 net47 was computed.  net471 net471 was computed.  net472 net472 is compatible.  net48 net48 was computed.  net481 net481 was computed. 
MonoAndroid monoandroid monoandroid was computed. 
MonoMac monomac monomac was computed. 
MonoTouch monotouch monotouch was computed. 
Tizen tizen40 tizen40 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.7.2

    • No dependencies.
  • .NETStandard 2.0

    • No dependencies.
  • net10.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on DoenaSoft.AbstractionLayer.Web:

Package Downloads
DoenaSoft.AbstractionLayer.Web.Default

Default System.Net-based implementations of web abstraction interfaces from DoenaSoft.AbstractionLayer.Web. Provides WebServices, WebClient, WebRequest, and WebResponse wrappers, plus HttpGetQueryBuilder for building URL-encoded query strings with proper handling of special characters (umlauts, ampersands, etc.).

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.0 208 3/28/2026
2.0.1 157 3/28/2026
2.0.0 157 3/28/2026
1.0.10 487 12/5/2023
1.0.9 253 12/3/2023
1.0.8 252 12/3/2023
1.0.7 238 12/3/2023
1.0.6 281 9/12/2023
1.0.5 252 9/12/2023
1.0.4 293 8/28/2023
1.0.3 283 8/28/2023
1.0.2 313 8/28/2023
1.0.1 291 8/28/2023
1.0.0 313 8/28/2023