2019-10-09 11:10:16 -04:00
|
|
|
using System;
|
2019-01-13 15:01:16 -05:00
|
|
|
using System.IO;
|
2019-03-08 14:17:17 -05:00
|
|
|
using System.Net.Http;
|
2019-12-10 18:13:57 -05:00
|
|
|
using System.Threading.Tasks;
|
2018-12-27 18:27:57 -05:00
|
|
|
|
|
|
|
namespace MediaBrowser.Common.Net
|
|
|
|
{
|
|
|
|
/// <summary>
|
2019-12-10 18:13:57 -05:00
|
|
|
/// Interface IHttpClient.
|
2018-12-27 18:27:57 -05:00
|
|
|
/// </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 11:34:56 -04:00
|
|
|
/// Warning: Deprecated function,
|
2019-10-09 11:10:16 -04:00
|
|
|
/// use 'Task{HttpResponseInfo} SendAsync(HttpRequestOptions options, HttpMethod httpMethod);' instead
|
2018-12-27 18:27:57 -05:00
|
|
|
/// Sends the asynchronous.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="options">The options.</param>
|
|
|
|
/// <param name="httpMethod">The HTTP method.</param>
|
|
|
|
/// <returns>Task{HttpResponseInfo}.</returns>
|
2019-10-09 11:10:16 -04:00
|
|
|
[Obsolete("Use 'Task{HttpResponseInfo} SendAsync(HttpRequestOptions options, HttpMethod httpMethod);' instead")]
|
2018-12-27 18:27:57 -05:00
|
|
|
Task<HttpResponseInfo> SendAsync(HttpRequestOptions options, string httpMethod);
|
|
|
|
|
2019-03-08 14:17:17 -05: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 18:27:57 -05: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 19:16:02 -05:00
|
|
|
}
|