2013-02-25 00:13:45 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.Common.Net
|
|
|
|
|
{
|
2013-02-26 03:43:04 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Interface IHttpClient
|
|
|
|
|
/// </summary>
|
2017-09-05 19:49:02 +00:00
|
|
|
|
public interface IHttpClient
|
2013-02-25 00:13:45 +00:00
|
|
|
|
{
|
2013-06-28 20:25:58 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the response.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="options">The options.</param>
|
|
|
|
|
/// <returns>Task{HttpResponseInfo}.</returns>
|
|
|
|
|
Task<HttpResponseInfo> GetResponse(HttpRequestOptions options);
|
|
|
|
|
|
2013-05-04 04:07:27 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the specified options.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="options">The options.</param>
|
|
|
|
|
/// <returns>Task{Stream}.</returns>
|
|
|
|
|
Task<Stream> Get(HttpRequestOptions options);
|
|
|
|
|
|
2014-04-21 16:02:30 +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, string httpMethod);
|
|
|
|
|
|
2013-12-16 18:44:03 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Posts the specified options.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="options">The options.</param>
|
|
|
|
|
/// <returns>Task{HttpResponseInfo}.</returns>
|
|
|
|
|
Task<HttpResponseInfo> Post(HttpRequestOptions options);
|
|
|
|
|
|
2013-02-25 00:13:45 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Downloads the contents of a given url into a temporary location
|
|
|
|
|
/// </summary>
|
2013-03-14 19:52:53 +00:00
|
|
|
|
/// <param name="options">The options.</param>
|
2013-02-25 00:13:45 +00:00
|
|
|
|
/// <returns>Task{System.String}.</returns>
|
|
|
|
|
/// <exception cref="System.ArgumentNullException">progress</exception>
|
|
|
|
|
/// <exception cref="MediaBrowser.Model.Net.HttpException"></exception>
|
2013-03-14 19:52:53 +00:00
|
|
|
|
Task<string> GetTempFile(HttpRequestOptions options);
|
2013-07-20 21:36:59 +00:00
|
|
|
|
|
2013-11-30 06:07:25 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the temporary file response.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="options">The options.</param>
|
|
|
|
|
/// <returns>Task{HttpResponseInfo}.</returns>
|
2013-07-20 21:36:59 +00:00
|
|
|
|
Task<HttpResponseInfo> GetTempFileResponse(HttpRequestOptions options);
|
2013-02-25 00:13:45 +00:00
|
|
|
|
}
|
|
|
|
|
}
|