DevBase.Net 1.2.0

dotnet add package DevBase.Net --version 1.2.0
                    
NuGet\Install-Package DevBase.Net -Version 1.2.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="DevBase.Net" Version="1.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DevBase.Net" Version="1.2.0" />
                    
Directory.Packages.props
<PackageReference Include="DevBase.Net" />
                    
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 DevBase.Net --version 1.2.0
                    
#r "nuget: DevBase.Net, 1.2.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 DevBase.Net@1.2.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=DevBase.Net&version=1.2.0
                    
Install as a Cake Addin
#tool nuget:?package=DevBase.Net&version=1.2.0
                    
Install as a Cake Tool

DevBase.Net

A modern, high-performance HTTP client library for .NET 9.0 with fluent API, SOCKS5 proxy support, retry policies, and advanced response parsing.

Features

  • Fluent request builder API
  • SOCKS5 proxy support with HttpToSocks5Proxy
  • Configurable retry policies (linear/exponential backoff)
  • JSON, HTML, XML parsing
  • JSON Path queries
  • Response streaming
  • Request/Response interceptors
  • Detailed request metrics
  • Connection pooling

Installation

dotnet add package DevBase.Net

Quick Start

using DevBase.Net.Core;

// Simple GET request
var response = await new Request("https://api.example.com/data").SendAsync();
string content = await response.GetStringAsync();

// POST with JSON
var response = await new Request("https://api.example.com/users")
    .AsPost()
    .WithJsonBody(new { name = "John" })
    .SendAsync();

Usage Examples

HTTP Methods

// GET (default)
var response = await new Request(url).SendAsync();

// POST
var response = await new Request(url).AsPost().WithJsonBody(data).SendAsync();

// PUT
var response = await new Request(url).AsPut().WithJsonBody(data).SendAsync();

// DELETE
var response = await new Request(url).AsDelete().SendAsync();

Headers and Authentication

var response = await new Request(url)
    .WithHeader("Authorization", "Bearer token")
    .WithHeader("X-Custom", "value")
    .SendAsync();

Response Parsing

// JSON
var data = await response.ParseJsonAsync<MyType>();

// JSON Path
var value = await response.ParseJsonPathAsync<string>("$.user.name");

// HTML
var doc = await response.ParseHtmlAsync();

// String
var text = await response.GetStringAsync();

Proxy Support (HTTP/HTTPS/SOCKS4/SOCKS5)

using DevBase.Net.Proxy;
using DevBase.Net.Proxy.Enums;

// HTTP Proxy
var httpProxy = new ProxyInfo("proxy.example.com", 8080, EnumProxyType.Http);

// SOCKS5 Proxy with authentication
var socks5Proxy = new ProxyInfo("proxy.example.com", 1080, "user", "pass", EnumProxyType.Socks5);

// SOCKS5h Proxy (remote DNS - more private)
var socks5hProxy = new ProxyInfo("proxy.example.com", 1080, EnumProxyType.Socks5h);

// Parse from string
var proxy = ProxyInfo.Parse("socks5://user:pass@proxy.example.com:1080");

// Use with request
var response = await new Request(url)
    .WithProxy(proxy)
    .SendAsync();

Proxied Batch Requests with Rotation

using DevBase.Net.Core;
using DevBase.Net.Proxy;

var proxiedBatch = new ProxiedBatchRequests()
    .WithRateLimit(5)
    .WithProxy("socks5://proxy1.example.com:1080")
    .WithProxy("socks5://proxy2.example.com:1080")
    .WithRoundRobinRotation()  // Or: WithRandomRotation(), WithLeastFailuresRotation()
    .OnProxyFailure((proxy, ctx) => Console.WriteLine($"Proxy {proxy.Key} failed"));

var batch = proxiedBatch.CreateBatch("scraping");
for (int i = 0; i < 100; i++)
    batch.Enqueue($"https://target.com/page/{i}");

var responses = await proxiedBatch.ExecuteAllAsync();

Retry Policies

var response = await new Request(url)
    .WithRetryPolicy(RetryPolicy.Exponential(maxRetries: 3))
    .SendAsync();

Batch Requests with Rate Limiting

using DevBase.Net.Core;

// Process many requests with controlled concurrency
var batchRequests = new BatchRequests()
    .WithRateLimit(3)  // 3 concurrent requests per second
    .WithCookiePersistence()
    .OnResponse(r => Console.WriteLine($"Status: {r.StatusCode}"))
    .OnProgress(p => Console.WriteLine($"{p.PercentComplete:F1}% complete"));

// Create batches
var batch = batchRequests.CreateBatch("api-calls");
for (int i = 0; i < 100; i++)
    batch.Enqueue($"https://api.example.com/item/{i}");

// Execute - sends 3 requests concurrently per second
var responses = await batchRequests.ExecuteAllAsync();

// Or stream results
await foreach (var response in batchRequests.ExecuteAllAsyncEnumerable())
{
    // Process as they complete
}

Credits

HttpToSocks5Proxy based on MihaZupan/HttpToSocks5Proxy (MIT License).

License

MIT License

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

NuGet packages (1)

Showing the top 1 NuGet packages that depend on DevBase.Net:

Package Downloads
DevBase.Api

DevBase.Api is designed to connect to certain api endpoints including Replicate.com, Tidal and Deezer

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.2.0 31 12/24/2025
1.1.0 38 12/23/2025