Use modern HttpClient

(cherry picked from commit 402f8b296f17bf161824ec5ff40d67d036d00d94)
This commit is contained in:
ta264
2021-11-10 21:59:08 +00:00
parent 5f946c0aa3
commit cef15887a4
39 changed files with 372 additions and 318 deletions
@@ -1,6 +1,7 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using Newtonsoft.Json;
using NzbDrone.Common.Serializer;
@@ -17,14 +18,14 @@ namespace NzbDrone.Common.Http
public JsonRpcRequestBuilder(string baseUrl)
: base(baseUrl)
{
Method = HttpMethod.POST;
Method = HttpMethod.Post;
JsonParameters = new List<object>();
}
public JsonRpcRequestBuilder(string baseUrl, string method, IEnumerable<object> parameters)
: base(baseUrl)
{
Method = HttpMethod.POST;
Method = HttpMethod.Post;
JsonMethod = method;
JsonParameters = parameters.ToList();
}