This commit is contained in:
Paul Schneider 2026-07-06 00:47:35 +01:00
commit 6ac264fa2c
8 changed files with 42 additions and 31 deletions

View file

@ -205,6 +205,16 @@ public class YavscApiClient : IAsyncDisposable
return dto!;
}
/// <summary>
/// Call a JSON endpoint with no request body while still allowing a
/// positional cancellation token argument.
/// </summary>
public Task<T> CallAsync<T>(
HttpMethod method,
string path,
CancellationToken ct)
=> CallAsync<T>(method, path, body: null, ct);
/// <summary>Call an endpoint that returns no useful body (DELETE, etc.).</summary>
public async Task CallAsync(
HttpMethod method,
@ -216,6 +226,16 @@ public class YavscApiClient : IAsyncDisposable
response.EnsureSuccessStatusCode();
}
/// <summary>
/// Call an endpoint with no request body while still allowing a
/// positional cancellation token argument.
/// </summary>
public Task CallAsync(
HttpMethod method,
string path,
CancellationToken ct)
=> CallAsync(method, path, body: null, ct);
private async Task<HttpResponseMessage> SendAsync(
HttpMethod method, string path, object? body, CancellationToken ct)
{