jellyfin/MediaBrowser.Common/Net/IHttpClient.cs

54 lines
1.9 KiB
C#
Raw Normal View History

using System;
using System.IO;
using System.Net.Http;
2019-12-10 23:13:57 +00:00
using System.Threading.Tasks;
2018-12-27 23:27:57 +00:00
namespace MediaBrowser.Common.Net
{
/// <summary>
2019-12-10 23:13:57 +00:00
/// Interface IHttpClient.
2018-12-27 23:27:57 +00: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>
/// Warning: Deprecated function,
/// 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>
[Obsolete("Use 'Task{HttpResponseInfo} SendAsync(HttpRequestOptions options, HttpMethod httpMethod);' instead")]
2018-12-27 23:27:57 +00:00
Task<HttpResponseInfo> SendAsync(HttpRequestOptions options, string httpMethod);
/// <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);
}
}