You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
jellyfin/MediaBrowser.ApiInteraction/BaseClient.cs

33 lines
790 B

using System;
using System.Net.Http;
namespace MediaBrowser.ApiInteraction
{
/// <summary>
/// Provides a base class used by the api and image services
/// </summary>
public abstract class BaseClient : IDisposable
{
public string ApiUrl { get; set; }
protected HttpClient HttpClient { get; private set; }
public BaseClient()
: this(new HttpClientHandler())
{
}
public BaseClient(HttpClientHandler clientHandler)
{
clientHandler.AutomaticDecompression = System.Net.DecompressionMethods.GZip;
HttpClient = new HttpClient(clientHandler);
}
public void Dispose()
{
HttpClient.Dispose();
}
}
}