2019-01-13 20:01:16 +00:00
|
|
|
using System.IO;
|
2018-12-27 23:27:57 +00:00
|
|
|
using System.Threading.Tasks;
|
2019-03-08 19:17:17 +00:00
|
|
|
using System.Net.Http;
|
2018-12-27 23:27:57 +00: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 15:34:56 +00:00
|
|
|
/// Warning: Deprecated function,
|
2019-03-08 19:17:17 +00:00
|
|
|
/// use 'Task<HttpResponseInfo> SendAsync(HttpRequestOptions options, HttpMethod httpMethod);' instead
|
2018-12-27 23:27:57 +00: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 19:17:17 +00: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 23:27:57 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Posts the specified options.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="options">The options.</param>
|
|
|
|
/// <returns>Task{HttpResponseInfo}.</returns>
|
|
|
|
Task<HttpResponseInfo> Post(HttpRequestOptions options);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Downloads the contents of a given url into a temporary location
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="options">The options.</param>
|
|
|
|
/// <returns>Task{System.String}.</returns>
|
|
|
|
/// <exception cref="System.ArgumentNullException">progress</exception>
|
2019-01-13 20:37:13 +00:00
|
|
|
/// <exception cref="Model.Net.HttpException"></exception>
|
2018-12-27 23:27:57 +00:00
|
|
|
Task<string> GetTempFile(HttpRequestOptions options);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the temporary file response.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="options">The options.</param>
|
|
|
|
/// <returns>Task{HttpResponseInfo}.</returns>
|
|
|
|
Task<HttpResponseInfo> GetTempFileResponse(HttpRequestOptions options);
|
|
|
|
}
|
2018-12-26 00:16:02 +00:00
|
|
|
}
|