From 2984abc9aa0429380459e5b5b6fda2d20058041b Mon Sep 17 00:00:00 2001 From: 杨宇千 Date: Sat, 19 Oct 2019 17:33:38 +0800 Subject: ... --- Timeline.Tests/Helpers/HttpClientExtensions.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Timeline.Tests/Helpers/HttpClientExtensions.cs') diff --git a/Timeline.Tests/Helpers/HttpClientExtensions.cs b/Timeline.Tests/Helpers/HttpClientExtensions.cs index b9204fcc..e3beea1d 100644 --- a/Timeline.Tests/Helpers/HttpClientExtensions.cs +++ b/Timeline.Tests/Helpers/HttpClientExtensions.cs @@ -1,6 +1,7 @@ using Newtonsoft.Json; using System.Net.Http; using System.Net.Http.Headers; +using System.Net.Mime; using System.Text; using System.Threading.Tasks; @@ -10,7 +11,8 @@ namespace Timeline.Tests.Helpers { public static Task PatchAsJsonAsync(this HttpClient client, string url, T body) { - return client.PatchAsync(url, new StringContent(JsonConvert.SerializeObject(body), Encoding.UTF8, "application/json")); + return client.PatchAsync(url, new StringContent( + JsonConvert.SerializeObject(body), Encoding.UTF8, MediaTypeNames.Application.Json)); } public static Task PutByteArrayAsync(this HttpClient client, string url, byte[] body, string mimeType) -- cgit v1.2.3