SpeckleHttp coverage (#244)
* Show code coverage for dev * SpeckleHttp coverage and moved base stuff around * add SpeckleHttpTests
This commit is contained in:
@@ -15,10 +15,15 @@ public class SpeckleHttp(ILogger<SpeckleHttp> logger, ISpeckleHttpClientHandlerF
|
||||
/// <param name="uri">The URI that should be pinged</param>
|
||||
/// <exception cref="System.Net.Http.HttpRequestException">Request to <paramref name="uri"/> failed</exception>
|
||||
public async Task<HttpResponseMessage> HttpPing(Uri uri)
|
||||
{
|
||||
using var httpClient = CreateHttpClient();
|
||||
return await HttpPing(uri, httpClient).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
public async Task<HttpResponseMessage> HttpPing(Uri uri, HttpClient httpClient)
|
||||
{
|
||||
try
|
||||
{
|
||||
using var httpClient = CreateHttpClient();
|
||||
HttpResponseMessage response = await httpClient.GetAsync(uri).ConfigureAwait(false);
|
||||
response.EnsureSuccessStatusCode();
|
||||
logger.LogInformation("Successfully pinged {uri}", uri);
|
||||
Reference in New Issue
Block a user