Soenneker.GitHub.Client.Http
4.0.1458
Prefix Reserved
dotnet add package Soenneker.GitHub.Client.Http --version 4.0.1458
NuGet\Install-Package Soenneker.GitHub.Client.Http -Version 4.0.1458
<PackageReference Include="Soenneker.GitHub.Client.Http" Version="4.0.1458" />
<PackageVersion Include="Soenneker.GitHub.Client.Http" Version="4.0.1458" />
<PackageReference Include="Soenneker.GitHub.Client.Http" />
paket add Soenneker.GitHub.Client.Http --version 4.0.1458
#r "nuget: Soenneker.GitHub.Client.Http, 4.0.1458"
#:package Soenneker.GitHub.Client.Http@4.0.1458
#addin nuget:?package=Soenneker.GitHub.Client.Http&version=4.0.1458
#tool nuget:?package=Soenneker.GitHub.Client.Http&version=4.0.1458
Soenneker.GitHub.Client.Http
Provides a cached HttpClient configured for GitHub's REST API, media type, API version, and bearer authentication.
Installation
dotnet add package Soenneker.GitHub.Client.Http
Configure and register
{
"GH": {
"Token": "your-github-token",
"RequestResponseLogging": false
}
}
using Soenneker.GitHub.Client.Http.Registrars;
services.AddGitHubHttpClientAsSingleton();
Keep the token in secret storage. Enable request/response logging only for controlled diagnostics: the authorization header is redacted, but URLs and bodies can still contain sensitive repository data.
Use the client
using Soenneker.GitHub.Client.Http.Abstract;
public sealed class GitHubRepositoryReader(IGitHubHttpClient clients)
{
public async Task<HttpResponseMessage> Get(
string owner,
string repository,
CancellationToken cancellationToken)
{
HttpClient client = await clients.Get(cancellationToken);
return await client.GetAsync($"repos/{owner}/{repository}", cancellationToken);
}
}
Callers borrow the returned client and must not dispose it. The provider removes its own cached client when disposed. Scoped providers use isolated cache entries, so disposing one scope cannot destroy another scope's transport.
| 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
- Soenneker.Extensions.Configuration (>= 4.0.883)
- Soenneker.HttpClients.LoggingHandler (>= 4.0.231)
- Soenneker.Utils.HttpClientCache (>= 4.0.2070)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Soenneker.GitHub.Client.Http:
| Package | Downloads |
|---|---|
|
Soenneker.GitHub.ClientUtil
Provides lazy, cached access to the generated GitHub REST API client. |
|
|
Soenneker.GitHub.Repositories.Rulesets
Creates, lists, and deletes GitHub repository rulesets |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.1458 | 1,404 | 9/9/2026 |
| 4.0.1457 | 85 | 9/9/2026 |
| 4.0.1456 | 255 | 9/9/2026 |
| 4.0.1455 | 105 | 9/9/2026 |
| 4.0.1454 | 1,089 | 9/9/2026 |
| 4.0.1453 | 159 | 9/9/2026 |
| 4.0.1452 | 60 | 9/8/2026 |
| 4.0.1451 | 997 | 9/8/2026 |
| 4.0.1450 | 2,029 | 9/8/2026 |
| 4.0.1449 | 1,335 | 9/8/2026 |
| 4.0.1448 | 1,237 | 9/8/2026 |
| 4.0.1447 | 271 | 9/8/2026 |
| 4.0.1446 | 75 | 9/8/2026 |
| 4.0.1445 | 100 | 9/7/2026 |
| 4.0.1444 | 958 | 9/7/2026 |
| 4.0.1442 | 76 | 9/7/2026 |
| 4.0.1441 | 1,639 | 9/7/2026 |
| 4.0.1440 | 92 | 9/7/2026 |
| 4.0.1439 | 5,650 | 9/5/2026 |
| 4.0.1438 | 399 | 9/5/2026 |
Updated Multiple NuGet packages