diff options
| author | LukePulverenti Luke Pulverenti luke pulverenti <LukePulverenti Luke Pulverenti luke.pulverenti@gmail.com> | 2012-07-31 21:53:40 -0400 |
|---|---|---|
| committer | LukePulverenti Luke Pulverenti luke pulverenti <LukePulverenti Luke Pulverenti luke.pulverenti@gmail.com> | 2012-07-31 21:53:40 -0400 |
| commit | 32f7ecf4d0876da9265599266de5e170e83d2d2b (patch) | |
| tree | bc08d57abd0adabc0f8eed4a10ac8c8446b897e3 /MediaBrowser.ApiInteraction/BaseClient.cs | |
| parent | 8edc1ce710406329a0239e54a348a86cd633e7ce (diff) | |
Added HttpClientHandler as a constructor param to ApiClient, and added automatic decompression.
Diffstat (limited to 'MediaBrowser.ApiInteraction/BaseClient.cs')
| -rw-r--r-- | MediaBrowser.ApiInteraction/BaseClient.cs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/MediaBrowser.ApiInteraction/BaseClient.cs b/MediaBrowser.ApiInteraction/BaseClient.cs index ab76b9e48..bd25b1653 100644 --- a/MediaBrowser.ApiInteraction/BaseClient.cs +++ b/MediaBrowser.ApiInteraction/BaseClient.cs @@ -13,8 +13,15 @@ namespace MediaBrowser.ApiInteraction protected HttpClient HttpClient { get; private set; }
public BaseClient()
+ : this(new HttpClientHandler())
{
- HttpClient = new HttpClient();
+ }
+
+ public BaseClient(HttpClientHandler clientHandler)
+ {
+ clientHandler.AutomaticDecompression = System.Net.DecompressionMethods.GZip;
+
+ HttpClient = new HttpClient(clientHandler);
}
public void Dispose()
|
