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
                    
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="Soenneker.GitHub.Client.Http" Version="11.0.1559" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.GitHub.Client.Http" Version="11.0.1559" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.GitHub.Client.Http" />
                    
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 Soenneker.GitHub.Client.Http --version 11.0.1559
                    
#r "nuget: Soenneker.GitHub.Client.Http, 11.0.1559"
                    
#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 Soenneker.GitHub.Client.Http@11.0.1559
                    
#: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=Soenneker.GitHub.Client.Http&version=11.0.1559
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.GitHub.Client.Http&version=11.0.1559
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

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 Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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

Updated Multiple NuGet packages