Added HttpClientHandler as a constructor param to ApiClient, and added automatic decompression.

This commit is contained in:
LukePulverenti Luke Pulverenti luke pulverenti
2012-07-31 21:53:40 -04:00
parent 8edc1ce710
commit 32f7ecf4d0
2 changed files with 20 additions and 12 deletions

View File

@@ -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()