Soenneker.GitHub.Client.Http
11.0.1559
Prefix Reserved
dotnet add package Soenneker.GitHub.Client.Http --version 11.0.1559
NuGet\Install-Package Soenneker.GitHub.Client.Http -Version 11.0.1559
<PackageReference Include="Soenneker.GitHub.Client.Http" Version="11.0.1559" />
<PackageVersion Include="Soenneker.GitHub.Client.Http" Version="11.0.1559" />
<PackageReference Include="Soenneker.GitHub.Client.Http" />
paket add Soenneker.GitHub.Client.Http --version 11.0.1559
#r "nuget: Soenneker.GitHub.Client.Http, 11.0.1559"
#:package Soenneker.GitHub.Client.Http@11.0.1559
#addin nuget:?package=Soenneker.GitHub.Client.Http&version=11.0.1559
#tool nuget:?package=Soenneker.GitHub.Client.Http&version=11.0.1559
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);
}
}
Use GetForUpload(cancellationToken) for asset uploads. It returns a separate cached client with a 10-minute overall request timeout and the same authentication and logging settings. Get keeps its existing default timeout. Caller cancellation tokens can cancel upload requests earlier.
Callers borrow the returned clients and must not dispose them. The provider removes both cached clients 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 | net11.0 is compatible. |
-
net11.0
- Soenneker.Extensions.Configuration (>= 11.0.917)
- Soenneker.HttpClients.LoggingHandler (>= 11.0.284)
- Soenneker.Utils.HttpClientCache (>= 11.0.2153)
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 |
|---|---|---|
| 11.0.1559 | 2,584 | 11/11/2026 |
| 11.0.1558 | 664 | 11/11/2026 |
| 11.0.1557 | 79 | 11/11/2026 |
| 11.0.1556 | 760 | 11/11/2026 |
| 11.0.1555 | 460 | 11/11/2026 |
| 11.0.1553 | 553 | 11/11/2026 |
| 11.0.1552 | 574 | 11/11/2026 |
| 11.0.1551 | 102 | 11/11/2026 |
| 11.0.1549 | 87 | 11/11/2026 |
| 11.0.1548 | 738 | 11/11/2026 |
| 11.0.1547 | 835 | 11/11/2026 |
| 11.0.1546 | 255 | 11/10/2026 |
| 11.0.1545 | 10,289 | 11/3/2026 |
| 11.0.1544 | 1,310 | 11/3/2026 |
| 11.0.1543 | 615 | 11/3/2026 |
| 11.0.1542 | 714 | 11/3/2026 |
| 11.0.1541 | 187 | 11/3/2026 |
| 11.0.1540 | 863 | 11/3/2026 |
| 11.0.1539 | 1,766 | 11/2/2026 |
| 11.0.1538 | 1,796 | 11/2/2026 |
Updated Multiple NuGet packages