diff options
author | 杨宇千 <crupest@outlook.com> | 2019-10-19 17:33:38 +0800 |
---|---|---|
committer | 杨宇千 <crupest@outlook.com> | 2019-10-19 17:33:38 +0800 |
commit | 2984abc9aa0429380459e5b5b6fda2d20058041b (patch) | |
tree | f75fde126094e8310dd9e2588bb9b9e8baa79a3b /Timeline.Tests/Helpers/HttpClientExtensions.cs | |
parent | def8e8dd78812c019a0d6e8e5a3e2de4e82ae3e4 (diff) | |
download | timeline-2984abc9aa0429380459e5b5b6fda2d20058041b.tar.gz timeline-2984abc9aa0429380459e5b5b6fda2d20058041b.tar.bz2 timeline-2984abc9aa0429380459e5b5b6fda2d20058041b.zip |
...
Diffstat (limited to 'Timeline.Tests/Helpers/HttpClientExtensions.cs')
-rw-r--r-- | Timeline.Tests/Helpers/HttpClientExtensions.cs | 4 |
1 files changed, 3 insertions, 1 deletions
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<HttpResponseMessage> PatchAsJsonAsync<T>(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<HttpResponseMessage> PutByteArrayAsync(this HttpClient client, string url, byte[] body, string mimeType)
|