From 48facb797ed912e4ea6b04b17d1ff190ac2daac4 Mon Sep 17 00:00:00 2001 From: stefan Date: Wed, 12 Sep 2018 19:26:21 +0200 Subject: Update to 3.5.2 and .net core 2.1 --- MediaBrowser.Common/Net/HttpRequestOptions.cs | 156 -------------------------- 1 file changed, 156 deletions(-) delete mode 100644 MediaBrowser.Common/Net/HttpRequestOptions.cs (limited to 'MediaBrowser.Common/Net/HttpRequestOptions.cs') diff --git a/MediaBrowser.Common/Net/HttpRequestOptions.cs b/MediaBrowser.Common/Net/HttpRequestOptions.cs deleted file mode 100644 index 8f0b155f3..000000000 --- a/MediaBrowser.Common/Net/HttpRequestOptions.cs +++ /dev/null @@ -1,156 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net; -using System.Threading; -using System.Text; - -namespace MediaBrowser.Common.Net -{ - /// - /// Class HttpRequestOptions - /// - public class HttpRequestOptions - { - /// - /// Gets or sets the URL. - /// - /// The URL. - public string Url { get; set; } - - public CompressionMethod? DecompressionMethod { get; set; } - - /// - /// Gets or sets the accept header. - /// - /// The accept header. - public string AcceptHeader - { - get { return GetHeaderValue("Accept"); } - set - { - RequestHeaders["Accept"] = value; - } - } - /// - /// Gets or sets the cancellation token. - /// - /// The cancellation token. - public CancellationToken CancellationToken { get; set; } - - /// - /// Gets or sets the resource pool. - /// - /// The resource pool. - public SemaphoreSlim ResourcePool { get; set; } - - /// - /// Gets or sets the user agent. - /// - /// The user agent. - public string UserAgent - { - get { return GetHeaderValue("User-Agent"); } - set - { - RequestHeaders["User-Agent"] = value; - } - } - - /// - /// Gets or sets the referrer. - /// - /// The referrer. - public string Referer { get; set; } - - /// - /// Gets or sets the host. - /// - /// The host. - public string Host { get; set; } - - /// - /// Gets or sets the progress. - /// - /// The progress. - public IProgress Progress { get; set; } - - /// - /// Gets or sets a value indicating whether [enable HTTP compression]. - /// - /// true if [enable HTTP compression]; otherwise, false. - public bool EnableHttpCompression { get; set; } - - public Dictionary RequestHeaders { get; private set; } - - public string RequestContentType { get; set; } - - public string RequestContent { get; set; } - public byte[] RequestContentBytes { get; set; } - - public bool BufferContent { get; set; } - - public bool LogRequest { get; set; } - public bool LogRequestAsDebug { get; set; } - public bool LogErrors { get; set; } - public bool LogResponse { get; set; } - public bool LogResponseHeaders { get; set; } - - public bool LogErrorResponseBody { get; set; } - public bool EnableKeepAlive { get; set; } - - public CacheMode CacheMode { get; set; } - public TimeSpan CacheLength { get; set; } - - public int TimeoutMs { get; set; } - public bool EnableDefaultUserAgent { get; set; } - - public bool AppendCharsetToMimeType { get; set; } - - private string GetHeaderValue(string name) - { - string value; - - RequestHeaders.TryGetValue(name, out value); - - return value; - } - - /// - /// Initializes a new instance of the class. - /// - public HttpRequestOptions() - { - EnableHttpCompression = true; - - RequestHeaders = new Dictionary(StringComparer.OrdinalIgnoreCase); - - LogRequest = true; - LogErrors = true; - CacheMode = CacheMode.None; - - TimeoutMs = 20000; - } - - public void SetPostData(IDictionary values) - { - var strings = values.Keys.Select(key => string.Format("{0}={1}", key, values[key])); - var postContent = string.Join("&", strings.ToArray()); - - RequestContent = postContent; - RequestContentType = "application/x-www-form-urlencoded"; - } - } - - public enum CacheMode - { - None = 0, - Unconditional = 1 - } - - public enum CompressionMethod - { - Deflate, - Gzip - } -} -- cgit v1.2.3