Czlovek.HttpCommunication 2.1.0-beta.85

This is a prerelease version of Czlovek.HttpCommunication.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Czlovek.HttpCommunication --version 2.1.0-beta.85
                    
NuGet\Install-Package Czlovek.HttpCommunication -Version 2.1.0-beta.85
                    
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="Czlovek.HttpCommunication" Version="2.1.0-beta.85" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Czlovek.HttpCommunication" Version="2.1.0-beta.85" />
                    
Directory.Packages.props
<PackageReference Include="Czlovek.HttpCommunication" />
                    
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 Czlovek.HttpCommunication --version 2.1.0-beta.85
                    
#r "nuget: Czlovek.HttpCommunication, 2.1.0-beta.85"
                    
#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 Czlovek.HttpCommunication@2.1.0-beta.85
                    
#: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=Czlovek.HttpCommunication&version=2.1.0-beta.85&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Czlovek.HttpCommunication&version=2.1.0-beta.85&prerelease
                    
Install as a Cake Tool

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 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. 
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 Czlovek.HttpCommunication:

Package Downloads
Czlovek.RabbitMq

Provides a RabbitMQ client with connection/channel pooling and configuration-driven topology.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.0-beta.1 0 7/19/2026
2.1.0-beta.85 69 6/16/2026
2.1.0-beta.84 61 5/7/2026
2.1.0-beta.83 58 5/7/2026
2.1.0-beta.82 107 3/20/2026
2.1.0-beta.81 83 2/21/2026
2.1.0-beta.80 76 2/21/2026
2.1.0-beta.79 79 2/13/2026
2.1.0-beta.78 83 2/11/2026
2.1.0-beta.77 77 2/11/2026
2.1.0-beta.76 73 2/10/2026
2.1.0-beta.75 82 2/10/2026
2.1.0-beta.74 85 1/28/2026
2.1.0-beta.73 202 11/6/2025
2.1.0-beta.72 190 11/6/2025
2.1.0-beta.71 195 11/4/2025
2.1.0-beta.70 183 11/4/2025
2.1.0-beta.69 179 11/4/2025
2.1.0-beta.68 194 11/4/2025
1.0.10 424 4/11/2023
Loading failed