PlainHttp 1.2.0
See the version list below for details.
dotnet add package PlainHttp --version 1.2.0
NuGet\Install-Package PlainHttp -Version 1.2.0
<PackageReference Include="PlainHttp" Version="1.2.0" />
<PackageVersion Include="PlainHttp" Version="1.2.0" />
<PackageReference Include="PlainHttp" />
paket add PlainHttp --version 1.2.0
#r "nuget: PlainHttp, 1.2.0"
#:package PlainHttp@1.2.0
#addin nuget:?package=PlainHttp&version=1.2.0
#tool nuget:?package=PlainHttp&version=1.2.0
PlainHttp

An easy HTTP client for .NET Core with support for serialization, proxies, testing, and more
Features
- Wraps
HttpClientand provides a cleaner and easier interface - Supports any HTTP method
- Per-request timeout with a custom
HttpRequestTimeoutException - Per-request proxy with transparent pooling
- Automatic serialization of objects to
JSON/XML/URL encoded - (no deserialization support)
- Download a file to disk
- Set a response encoding
- Option to disable automatic reading of the response body
- Automatically enabled decompression of GZIP and DEFLATE responses
- Allows to mock requests for unit testing
- Heavily used in production by @botfactoryit to send 4 million requests per day
Why .NET Core 3.1
This library targets .NET Core 3.1 (LTS) because it requires the PooledConnectionLifetime property on HttpMessageHandler, introduced in .NET Core 2.2. This makes sure that reusing the same HttpClient for a long time doesn't have unintended consequences affecting DNS resolution. This library in fact keeps a pool of HttpClient instances that are never disposed.
In particular, the library keeps:
- One
HttpClientper request host - One
HttpClientper proxy
There is currently no mechanism that disposes HttpClient instances that are unused, so if you use a lot of random proxies or many different hostnames, you might get into trouble. This can be easily improved by creating a custom IHttpClientFactory, and then passing the factory to each request through the HttpClientFactory property.
Usage
Full usage instructions are available on GitHub.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. 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. |
| .NET Core | netcoreapp3.1 is compatible. |
-
.NETCoreApp 3.1
- Flurl (>= 3.0.0)
- Newtonsoft.Json (>= 12.0.3)
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 | 2,463 | 12/19/2024 |
| 2.0.0 | 5,643 | 1/24/2024 |
| 2.0.0-pre3 | 153 | 1/24/2024 |
| 2.0.0-pre2 | 382 | 11/21/2023 |
| 2.0.0-pre1 | 302 | 10/28/2023 |
| 1.3.0 | 1,723 | 8/1/2022 |
| 1.2.0 | 1,557 | 11/27/2020 |
| 1.1.2 | 962 | 6/24/2020 |
| 1.1.1 | 624 | 6/19/2020 |
| 1.1.0 | 634 | 6/18/2020 |
| 1.0.3 | 1,114 | 12/12/2019 |
| 1.0.2 | 739 | 12/4/2019 |
| 1.0.1 | 979 | 10/3/2019 |
| 1.0.0 | 1,142 | 8/16/2019 |