Czlovek.HttpCommunication 2.1.0-beta.75

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.75
                    
NuGet\Install-Package Czlovek.HttpCommunication -Version 2.1.0-beta.75
                    
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.75" />
                    
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.75" />
                    
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.75
                    
#r "nuget: Czlovek.HttpCommunication, 2.1.0-beta.75"
                    
#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.75
                    
#: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.75&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Czlovek.HttpCommunication&version=2.1.0-beta.75&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

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
Loading failed