OpenUrzednik.Transport.Http
1.1.0-preview.121.gdc045d8e7a
Prefix Reserved
dotnet add package OpenUrzednik.Transport.Http --version 1.1.0-preview.121.gdc045d8e7a
NuGet\Install-Package OpenUrzednik.Transport.Http -Version 1.1.0-preview.121.gdc045d8e7a
<PackageReference Include="OpenUrzednik.Transport.Http" Version="1.1.0-preview.121.gdc045d8e7a" />
<PackageVersion Include="OpenUrzednik.Transport.Http" Version="1.1.0-preview.121.gdc045d8e7a" />
<PackageReference Include="OpenUrzednik.Transport.Http" />
paket add OpenUrzednik.Transport.Http --version 1.1.0-preview.121.gdc045d8e7a
#r "nuget: OpenUrzednik.Transport.Http, 1.1.0-preview.121.gdc045d8e7a"
#:package OpenUrzednik.Transport.Http@1.1.0-preview.121.gdc045d8e7a
#addin nuget:?package=OpenUrzednik.Transport.Http&version=1.1.0-preview.121.gdc045d8e7a&prerelease
#tool nuget:?package=OpenUrzednik.Transport.Http&version=1.1.0-preview.121.gdc045d8e7a&prerelease
OpenUrzednik.Transport.Http
⚠️ Unofficial: OpenUrzednik.NET is a community project. It is not affiliated with, authorized or endorsed by Narodowy Bank Polski (NBP) or any other Polish public institution.
The HTTP transport types of OpenUrzednik.NET: the errors a REST client returns when an HTTP response caused them, and their status code.
Part of OpenUrzednik.NET. See the main README for an overview of the project.
Installation
Every REST provider (e.g. OpenUrzednik.Nbp) depends on this package, so you get it with the provider. Install it on its own only if you build your own client in the same style:
dotnet add package OpenUrzednik.Transport.Http
Usage
OpenUrzednik.Core describes conditions (not found, rate limited, unavailable), whatever the transport. When an HTTP response caused the error, a client returns the condition's HTTP subclass from this package:
| HTTP response | Error | It is a |
|---|---|---|
| 400 | HttpBadRequestError |
BadRequestError |
| 401, 403 | HttpUnauthorizedError |
UnauthorizedError |
| 404 | HttpNotFoundError |
NotFoundError |
| 408 | HttpRequestTimeoutError |
RequestTimeoutError |
| 429 | HttpRateLimitExceededError |
RateLimitExceededError |
| 5xx | HttpServiceUnavailableError |
ServiceUnavailableError |
| another status | HttpUnknownError |
UnknownError |
A provider may map a status to another condition (e.g. a quota answered with 400); the error is then that condition's HTTP subclass. Every subclass keeps its condition's Code and exception, so your is NotFoundError and Code checks handle an HttpNotFoundError like any other NotFoundError. A provider can derive its own type from an HTTP subclass to add details of its API, such as its error code; its README names those types, and they pass the same checks. Read the status through IOpenUrzednikHttpStatusCode:
using System.Net;
using OpenUrzednik.Transport.Http;
var result = await client.GetAsync(date);
if (result.IsFailure && result.Errors[0] is IOpenUrzednikHttpStatusCode http)
Console.WriteLine($"HTTP {(int)http.StatusCode}");
// Or, without a type check: null when no HTTP response caused the error.
HttpStatusCode? status = result.Errors[0].GetHttpStatus();
An error with no HTTP response behind it is Core's plain type (or a provider's subclass of it): an empty answer (NotFoundError), a client-side timeout (RequestTimeoutError), a resilience handler's rejection (ServiceUnavailableError) or a network failure (ConnectionFailedError).
The status is a System.Net.HttpStatusCode. 429 Too Many Requests (RFC 6585) has no named member on netstandard2.0 and .NET Framework, so compare with (HttpStatusCode)429 there. TryGetHttpStatus(out var status) is the non-nullable form of GetHttpStatus().
Metadata holds the status as an int under "statusCode" (HttpStatusExtensions.StatusCodeMetadataKey), the type OpenTelemetry uses for http.response.status_code, so you can copy Metadata into a ProblemDetails response as it is.
Core's GetHttpStatusCode() and TryGetHttpStatusCode() (HttpErrorMetadata) are obsolete: they keep working until 2.0, but use GetHttpStatus() from this package.
Compatibility
IOpenUrzednikHttpStatusCode never gets a new member: a further HTTP detail comes as a separate interface. The HTTP error types stay unsealed, so providers can derive from them. Code that compares the exact type (error.GetType() == typeof(NotFoundError), or typeof(HttpNotFoundError), which a provider's subclass doesn't match) misses them; use is or Code.
Dependencies
OpenUrzednik.Core only. The .NET builds are trimming- and Native AOT-safe.
| 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 is compatible. 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 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- OpenUrzednik.Core (>= 1.1.0-preview.121.gdc045d8e7a)
-
net10.0
- OpenUrzednik.Core (>= 1.1.0-preview.121.gdc045d8e7a)
-
net8.0
- OpenUrzednik.Core (>= 1.1.0-preview.121.gdc045d8e7a)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on OpenUrzednik.Transport.Http:
| Package | Downloads |
|---|---|
|
OpenUrzednik.Nbp
Unofficial .NET client for the NBP (Narodowy Bank Polski) API: currency exchange rates, rate tables and gold prices. Not affiliated with NBP. |
|
|
OpenUrzednik.MF.WhiteList
Unofficial .NET client for the Polish Ministry of Finance VAT White List API (Wykaz podatników VAT): search by NIP, REGON or account number, check an account against a NIP or REGON, and the WL2 VAT status, each answer with its requestId proof. Not affiliated with the Ministry of Finance. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.1.0-preview.121.gdc045d8e7a | 0 | 11/22/2026 |
| 1.1.0-preview.119.g97e13fdebd | 0 | 11/22/2026 |
| 1.1.0-preview.116.g1b1671583e | 0 | 11/22/2026 |
| 1.1.0-preview.114.g9f96ff8840 | 11 | 11/21/2026 |
| 1.1.0-preview.112.g0fbe786a11 | 33 | 11/21/2026 |
| 1.1.0-preview.110.g3ee79ea816 | 35 | 11/21/2026 |
| 1.1.0-preview.108.g0dedd69cb8 | 41 | 11/21/2026 |
| 1.1.0-preview.106.g55562a4ff1 | 48 | 11/21/2026 |
| 1.1.0-preview.104.g114d53fbb1 | 42 | 11/21/2026 |
| 1.1.0-preview.102.g7e6caa33d5 | 48 | 11/21/2026 |
| 1.1.0-preview.100.g8dda39bc1f | 43 | 11/20/2026 |
| 1.1.0-preview.97.g341353d6eb | 61 | 11/20/2026 |
| 1.1.0-preview.93.g281b9eefb4 | 44 | 11/20/2026 |
| 1.1.0-preview.91.g61717a1cd6 | 44 | 11/20/2026 |
| 1.1.0-preview.88.gd6a66135c5 | 49 | 11/20/2026 |
| 1.1.0-preview.83.g6941cae4c2 | 47 | 11/20/2026 |
| 1.1.0-preview.79.g084b91667f | 50 | 11/20/2026 |
| 1.1.0-preview.75.gc8a0a00161 | 47 | 11/20/2026 |
| 1.1.0-preview.73.ga3cd8a5122 | 47 | 11/20/2026 |
| 1.1.0-preview.71.g29c6922015 | 46 | 11/20/2026 |