Remove usage of depricated 'WebRequest'

Ref: https://docs.microsoft.com/en-us/dotnet/api/system.net.webrequest?view=netframework-4.7.2
This commit is contained in:
Bond-009
2019-03-08 20:17:17 +01:00
committed by DrPandemic
parent d5fe82314e
commit 067200be83
4 changed files with 164 additions and 304 deletions

View File

@@ -99,7 +99,6 @@ namespace MediaBrowser.Common.Net
public bool EnableDefaultUserAgent { get; set; }
public bool AppendCharsetToMimeType { get; set; }
public string DownloadFilePath { get; set; }
private string GetHeaderValue(string name)
{

View File

@@ -1,5 +1,6 @@
using System.IO;
using System.Threading.Tasks;
using System.Net.Http;
namespace MediaBrowser.Common.Net
{
@@ -23,6 +24,8 @@ namespace MediaBrowser.Common.Net
Task<Stream> Get(HttpRequestOptions options);
/// <summary>
/// Warning: Depricated function,
/// use 'Task<HttpResponseInfo> SendAsync(HttpRequestOptions options, HttpMethod httpMethod);' instead
/// Sends the asynchronous.
/// </summary>
/// <param name="options">The options.</param>
@@ -30,6 +33,14 @@ namespace MediaBrowser.Common.Net
/// <returns>Task{HttpResponseInfo}.</returns>
Task<HttpResponseInfo> SendAsync(HttpRequestOptions options, string httpMethod);
/// <summary>
/// Sends the asynchronous.
/// </summary>
/// <param name="options">The options.</param>
/// <param name="httpMethod">The HTTP method.</param>
/// <returns>Task{HttpResponseInfo}.</returns>
Task<HttpResponseInfo> SendAsync(HttpRequestOptions options, HttpMethod httpMethod);
/// <summary>
/// Posts the specified options.
/// </summary>