using Newtonsoft.Json; using System.Net.Http; using System.Text; using System.Threading.Tasks; namespace Timeline.Tests.Helpers { public static class HttpClientExtensions { public static Task PatchAsJsonAsync(this HttpClient client, string url, T body) { return client.PatchAsync(url, new StringContent(JsonConvert.SerializeObject(body), Encoding.UTF8, "application/json")); } } }