2019-01-13 13:01:16 -07:00
|
|
|
using System.IO;
|
2018-12-27 16:27:57 -07:00
|
|
|
using System.Threading.Tasks;
|
2019-03-08 12:17:17 -07:00
|
|
|
using System.Net.Http;
|
2018-12-27 16:27:57 -07:00
|
|
|
|
|
|
|
namespace MediaBrowser.Common.Net
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// Interface IHttpClient
|
|
|
|
/// </summary>
|
|
|
|
public interface IHttpClient
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the response.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="options">The options.</param>
|
|
|
|
/// <returns>Task{HttpResponseInfo}.</returns>
|
|
|
|
Task<HttpResponseInfo> GetResponse(HttpRequestOptions options);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the specified options.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="options">The options.</param>
|
|
|
|
/// <returns>Task{Stream}.</returns>
|
|
|
|
Task<Stream> Get(HttpRequestOptions options);
|
|
|
|
|
|
|
|
/// <summary>
|
2019-03-27 08:34:56 -07:00
|
|
|
/// Warning: Deprecated function,
|
2019-03-08 12:17:17 -07:00
|
|
|
/// use 'Task<HttpResponseInfo> SendAsync(HttpRequestOptions options, HttpMethod httpMethod);' instead
|
2018-12-27 16:27:57 -07:00
|
|
|
/// Sends the asynchronous.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="options">The options.</param>
|
|
|
|
/// <param name="httpMethod">The HTTP method.</param>
|
|
|
|
/// <returns>Task{HttpResponseInfo}.</returns>
|
|
|
|
Task<HttpResponseInfo> SendAsync(HttpRequestOptions options, string httpMethod);
|
|
|
|
|
2019-03-08 12:17:17 -07:00
|
|
|
/// <summary>
|
|
|
|
/// Sends the asynchronous.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="options">The options.</param>
|
|
|
|
/// <param name="httpMethod">The HTTP method.</param>
|
|
|
|
/// <returns>Task{HttpResponseInfo}.</returns>
|
|
|
|
Task<HttpResponseInfo> SendAsync(HttpRequestOptions options, HttpMethod httpMethod);
|
|
|
|
|
2018-12-27 16:27:57 -07:00
|
|
|
/// <summary>
|
|
|
|
/// Posts the specified options.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="options">The options.</param>
|
|
|
|
/// <returns>Task{HttpResponseInfo}.</returns>
|
|
|
|
Task<HttpResponseInfo> Post(HttpRequestOptions options);
|
|
|
|
}
|
2018-12-25 17:16:02 -07:00
|
|
|
}
|