async Task <Card> PostCard(Card card) { HttpRequestMessage request() => new HttpRequestMessage(HttpMethod.Post, new Uri("/api/card", UriKind.Relative)) { Content = ToJsonContent(card).HttpContent }; var response = await sessionManager.Send(request); return(JsonConvert.DeserializeObject <Card>(response)); }
async Task <Card> PostCard(Card card) { HttpRequestMessage request() => new HttpRequestMessage(HttpMethod.Post, new Uri("/api/card", UriKind.Relative)) { Content = ToJsonContent(card).HttpContent }; var response = await sessionManager.Send(request); try { return(JsonConvert.DeserializeObject <Card>(response)); } catch (JsonSerializationException e) { throw new MetabaseApiException($"Error parsing response for {nameof(Card)} from:\n{response}", e); } }