tests
This commit is contained in:
parent
c08ff81776
commit
6ac264fa2c
8 changed files with 42 additions and 31 deletions
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue