Czlovek.HttpCommunication
2.1.0-beta.84
dotnet add package Czlovek.HttpCommunication --version 2.1.0-beta.84
NuGet\Install-Package Czlovek.HttpCommunication -Version 2.1.0-beta.84
<PackageReference Include="Czlovek.HttpCommunication" Version="2.1.0-beta.84" />
<PackageVersion Include="Czlovek.HttpCommunication" Version="2.1.0-beta.84" />
<PackageReference Include="Czlovek.HttpCommunication" />
paket add Czlovek.HttpCommunication --version 2.1.0-beta.84
#r "nuget: Czlovek.HttpCommunication, 2.1.0-beta.84"
#:package Czlovek.HttpCommunication@2.1.0-beta.84
#addin nuget:?package=Czlovek.HttpCommunication&version=2.1.0-beta.84&prerelease
#tool nuget:?package=Czlovek.HttpCommunication&version=2.1.0-beta.84&prerelease
User Agent and Download Utils
This code provides utility functions related to user agent strings and downloading files using HttpClient.
Usage
Generating a random user agent string
To generate a random user agent string, call the RandomUserAgent method:
string randomUserAgent = Utils.RandomUserAgent;
Generating a random desktop or mobile user agent string
To generate a random user agent string specific to desktop or mobile, call RandomDesktopUserAgent or RandomMobileUserAgent, respectively:
string randomDesktopUserAgent = Utils.RandomDesktopUserAgent; string randomMobileUserAgent = Utils.RandomMobileUserAgent;
Generating a random operating system user agent string
To generate a random operating system user agent string, call RandomOsUserAgent:
string randomOsUserAgent = Utils.RandomOsUserAgent;
Downloading a file with HttpClient
To download a file using HttpClient and save it to disk with the given file name, call the Download method. This method returns a Task<bool> representing the completion of the download, with true indicating success and false indicating failure. An optional ILogger instance can be provided to log download progress and errors.
HttpClient httpClient = new HttpClient();
Uri uri = new Uri("http://example.com/file.txt");
string fileName = "file.txt";
ILogger logger = null;
bool success = await Utils.Download(httpClient, uri, fileName, logger);
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- Czlovek.Randomness (>= 2.1.0-beta.84)
- Microsoft.AspNetCore.Http.Abstractions (>= 2.3.9)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.7)
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 |
|---|---|---|
| 2.1.0-beta.84 | 44 | 5/7/2026 |
| 2.1.0-beta.83 | 45 | 5/7/2026 |
| 2.1.0-beta.82 | 93 | 3/20/2026 |
| 2.1.0-beta.81 | 70 | 2/21/2026 |
| 2.1.0-beta.80 | 64 | 2/21/2026 |
| 2.1.0-beta.79 | 66 | 2/13/2026 |
| 2.1.0-beta.78 | 73 | 2/11/2026 |
| 2.1.0-beta.77 | 65 | 2/11/2026 |
| 2.1.0-beta.76 | 61 | 2/10/2026 |
| 2.1.0-beta.75 | 71 | 2/10/2026 |
| 2.1.0-beta.74 | 74 | 1/28/2026 |
| 2.1.0-beta.73 | 193 | 11/6/2025 |
| 2.1.0-beta.72 | 177 | 11/6/2025 |
| 2.1.0-beta.71 | 187 | 11/4/2025 |
| 2.1.0-beta.70 | 175 | 11/4/2025 |
| 2.1.0-beta.69 | 170 | 11/4/2025 |
| 2.1.0-beta.68 | 182 | 11/4/2025 |
| 2.1.0-beta.67 | 182 | 11/2/2025 |
| 2.1.0-beta.66 | 191 | 11/2/2025 |
| 1.0.10 | 411 | 4/11/2023 |