aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2013-12-05 11:50:21 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2013-12-05 11:50:21 -0500
commit55a776427b97bec48a70a4b4f403b52935b620ea (patch)
tree5fc0e1feaee36df2116a4842d3eb9d27c491bbae /MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs
parent9e84a712ae3da9eada815e790160a17153b76d37 (diff)
Removed unused properties from BaseItem.
Diffstat (limited to 'MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs')
-rw-r--r--MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs9
1 files changed, 6 insertions, 3 deletions
diff --git a/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs b/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs
index 214ed106d..19091885d 100644
--- a/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs
+++ b/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs
@@ -103,21 +103,24 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager
private WebRequest GetMonoRequest(HttpRequestOptions options, string method, bool enableHttpCompression)
{
- var request = WebRequest.Create(options.Url);
+ var request = (HttpWebRequest)WebRequest.Create(options.Url);
if (!string.IsNullOrEmpty(options.AcceptHeader))
{
- request.Headers.Add("Accept", options.AcceptHeader);
+ request.Accept = options.AcceptHeader;
}
+ request.AutomaticDecompression = enableHttpCompression ? DecompressionMethods.Deflate : DecompressionMethods.None;
request.CachePolicy = new RequestCachePolicy(RequestCacheLevel.Revalidate);
request.ConnectionGroupName = GetHostFromUrl(options.Url);
+ request.KeepAlive = true;
request.Method = method;
+ request.Pipelined = true;
request.Timeout = 20000;
if (!string.IsNullOrEmpty(options.UserAgent))
{
- request.Headers.Add("User-Agent", options.UserAgent);
+ request.UserAgent = options.UserAgent;
}
return request;