diff --git a/Octokit/Http/Connection.cs b/Octokit/Http/Connection.cs index 06dc5ee0..45b65406 100644 --- a/Octokit/Http/Connection.cs +++ b/Octokit/Http/Connection.cs @@ -22,6 +22,7 @@ namespace Octokit readonly Authenticator _authenticator; readonly JsonHttpPipeline _jsonPipeline; + readonly IHttpClient _httpClient; /// /// Creates a new connection instance used to make requests of the GitHub API. @@ -130,7 +131,7 @@ namespace Octokit UserAgent = FormatUserAgent(productInformation); BaseAddress = baseAddress; _authenticator = new Authenticator(credentialStore); - HttpClient = httpClient; + _httpClient = httpClient; _jsonPipeline = new JsonHttpPipeline(); } @@ -334,15 +335,6 @@ namespace Octokit } } - /// - /// The Http Client adapter instance used to make the actual request. - /// - public IHttpClient HttpClient - { - get; - private set; - } - Task> GetHtml(IRequest request) { request.Headers.Add("Accept", "application/vnd.github.html"); @@ -362,7 +354,7 @@ namespace Octokit { request.Headers.Add("User-Agent", UserAgent); await _authenticator.Apply(request).ConfigureAwait(false); - var response = await HttpClient.Send(request, cancellationToken).ConfigureAwait(false); + var response = await _httpClient.Send(request, cancellationToken).ConfigureAwait(false); ApiInfoParser.ParseApiHttpHeaders(response); HandleErrors(response); return response; diff --git a/Octokit/Http/IConnection.cs b/Octokit/Http/IConnection.cs index 32e6e146..7d2d335a 100644 --- a/Octokit/Http/IConnection.cs +++ b/Octokit/Http/IConnection.cs @@ -148,10 +148,5 @@ namespace Octokit /// the default with just these credentials. /// Credentials Credentials { get; set; } - - /// - /// The Http Client adapter instance used to make the actual request. - /// - IHttpClient HttpClient { get; } } }