public async Task <string> CreateCardAsync(CardDetails details, CancellationToken cancellationToken = default) { using var requestContent = new StringContent( JsonSerializer.Serialize(details), Encoding.UTF8, MediaTypeNames.Application.Json); using var response = await client.PostAsync(this.endpoint, requestContent, cancellationToken).ConfigureAwait(false); response.EnsureSuccessStatusCode(); string responseBody = await response.Content.ReadAsStringAsync().ConfigureAwait(false); string cardId = JsonSerializer.Deserialize <string>(responseBody); return(cardId); }
public Task SetDetailsAsync(CardDetails details) { return(proxy.InvokeAsync(nameof(ICardActor.SetDetailsAsync), details)); }