core: refactor http webclient part 13 #8529 (#8941)

Merge string/byte request code
This commit is contained in:
Cory
2020-06-11 10:09:27 -05:00
committed by ngosang
parent 22bced9ca3
commit 4d63fa81d5
91 changed files with 330 additions and 399 deletions

View File

@@ -12,6 +12,7 @@ using Jackett.Common.Models;
using Jackett.Common.Models.IndexerConfig.Bespoke;
using Jackett.Common.Services.Interfaces;
using Jackett.Common.Utils;
using Jackett.Common.Utils.Clients;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using NLog;
@@ -179,7 +180,7 @@ namespace Jackett.Common.Indexers
}
// Get the content from the tracker
var response = await RequestStringWithCookiesAndRetry(queryUrl);
var response = await RequestWithCookiesAndRetryAsync(queryUrl);
if (!response.ContentString.StartsWith("{")) // not JSON => error
throw new ExceptionWithConfigData("unexcepted response (not JSON)", configData);
dynamic json = JsonConvert.DeserializeObject<dynamic>(response.ContentString);