using System;
using System.Collections.Generic;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
namespace MediaBrowser.Common.Net
{
///
/// Interface IHttpClient
///
public interface IHttpClient : IDisposable
{
///
/// Performs a GET request and returns the resulting stream
///
/// The URL.
/// The resource pool.
/// The cancellation token.
/// Task{Stream}.
///
Task Get(string url, SemaphoreSlim resourcePool, CancellationToken cancellationToken);
///
/// Performs a POST request
///
/// The URL.
/// Params to add to the POST data.
/// The resource pool.
/// The cancellation token.
/// stream on success, null on failure
/// postData
///
Task Post(string url, Dictionary postData, SemaphoreSlim resourcePool, CancellationToken cancellationToken);
///
/// Downloads the contents of a given url into a temporary location
///
/// The URL.
/// The resource pool.
/// The cancellation token.
/// The progress.
/// The user agent.
/// Task{System.String}.
/// progress
///
Task GetTempFile(string url, SemaphoreSlim resourcePool, CancellationToken cancellationToken, IProgress progress, string userAgent = null);
///
/// Downloads the contents of a given url into a MemoryStream
///
/// The URL.
/// The resource pool.
/// The cancellation token.
/// Task{MemoryStream}.
///
Task GetMemoryStream(string url, SemaphoreSlim resourcePool, CancellationToken cancellationToken);
}
}