/Web/wasHTTPClient.cs |
@@ -65,10 +65,11 @@ |
} |
// Add some standard headers: |
// Accept - for socially acceptable security of mod_sec |
// Accept-Encoding - since we want to use compression if possible |
switch (headers != null) |
{ |
case false: |
headers = new Dictionary<string, string> {{"Accept", @"*/*"}}; |
headers = new Dictionary<string, string> {{"Accept", @"*/*"}, {"Accept-Encoding", "gzip,defalate"}}; |
break; |
default: |
if (!headers.ContainsKey("Accept")) |
@@ -75,6 +76,10 @@ |
{ |
headers.Add("Accept", @"*/*"); |
} |
if (!headers.ContainsKey("Accept-Encoding")) |
{ |
headers.Add("Accept-Encoding", "gzip,deflate"); |
} |
break; |
} |
foreach (var header in headers) |
@@ -114,10 +119,15 @@ |
} |
// Add some standard headers: |
// Accept - for socially acceptable security of mod_sec |
// Accept-Encoding - since we want to use compression if possible |
if (!headers.ContainsKey("Accept")) |
{ |
headers.Add("Accept", @"*/*"); |
} |
if (!headers.ContainsKey("Accept-Encoding")) |
{ |
headers.Add("Accept-Encoding", "gzip,deflate"); |
} |
using (var response = await HTTPClient.SendAsync(request)) |
{ |
return response.IsSuccessStatusCode |
@@ -163,10 +173,15 @@ |
} |
// Add some standard headers: |
// Accept - for socially acceptable security of mod_sec |
// Accept-Encoding - since we want to use compression if possible |
if (!headers.ContainsKey("Accept")) |
{ |
headers.Add("Accept", @"*/*"); |
} |
if (!headers.ContainsKey("Accept-Encoding")) |
{ |
headers.Add("Accept-Encoding", "gzip,deflate"); |
} |
using (var response = await HTTPClient.SendAsync(request)) |
{ |
return response.IsSuccessStatusCode |