mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-26 10:44:50 +03:00
improve httpclient resource disposal
This commit is contained in:
@@ -18,24 +18,6 @@ namespace MediaBrowser.Common.Net
|
||||
/// <returns>Task{HttpResponseInfo}.</returns>
|
||||
Task<HttpResponseInfo> GetResponse(HttpRequestOptions options);
|
||||
|
||||
/// <summary>
|
||||
/// Performs a GET request and returns the resulting stream
|
||||
/// </summary>
|
||||
/// <param name="url">The URL.</param>
|
||||
/// <param name="resourcePool">The resource pool.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task{Stream}.</returns>
|
||||
/// <exception cref="MediaBrowser.Model.Net.HttpException"></exception>
|
||||
Task<Stream> Get(string url, SemaphoreSlim resourcePool, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the specified URL.
|
||||
/// </summary>
|
||||
/// <param name="url">The URL.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task{Stream}.</returns>
|
||||
Task<Stream> Get(string url, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the specified options.
|
||||
/// </summary>
|
||||
@@ -51,35 +33,6 @@ namespace MediaBrowser.Common.Net
|
||||
/// <returns>Task{HttpResponseInfo}.</returns>
|
||||
Task<HttpResponseInfo> SendAsync(HttpRequestOptions options, string httpMethod);
|
||||
|
||||
/// <summary>
|
||||
/// Performs a POST request
|
||||
/// </summary>
|
||||
/// <param name="url">The URL.</param>
|
||||
/// <param name="postData">Params to add to the POST data.</param>
|
||||
/// <param name="resourcePool">The resource pool.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>stream on success, null on failure</returns>
|
||||
/// <exception cref="System.ArgumentNullException">postData</exception>
|
||||
/// <exception cref="MediaBrowser.Model.Net.HttpException"></exception>
|
||||
Task<Stream> Post(string url, Dictionary<string, string> postData, SemaphoreSlim resourcePool, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Posts the specified URL.
|
||||
/// </summary>
|
||||
/// <param name="url">The URL.</param>
|
||||
/// <param name="postData">The post data.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task{Stream}.</returns>
|
||||
Task<Stream> Post(string url, Dictionary<string, string> postData, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Posts the specified options with post data
|
||||
/// </summary>
|
||||
/// <param name="options">The options</param>
|
||||
/// <param name="postData">The post data</param>
|
||||
/// <returns>Task{Stream}</returns>
|
||||
Task<Stream> Post(HttpRequestOptions options, Dictionary<string, string> postData);
|
||||
|
||||
/// <summary>
|
||||
/// Posts the specified options.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user