aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Common/Net/IHttpClient.cs
diff options
context:
space:
mode:
authorLukePulverenti <luke.pulverenti@gmail.com>2013-03-03 00:25:42 -0500
committerLukePulverenti <luke.pulverenti@gmail.com>2013-03-03 00:25:42 -0500
commit627b8370a89cbf9826898c2edfc46767dfb5272a (patch)
treec1ae00d80c4923e0aa1429a93de665ffcf718e01 /MediaBrowser.Common/Net/IHttpClient.cs
parentf26a3e3c615474eb9f64f005448bb8ce4b08e13f (diff)
made IHttpClient a little more flexible, allow Semaphore to be optional
Diffstat (limited to 'MediaBrowser.Common/Net/IHttpClient.cs')
-rw-r--r--MediaBrowser.Common/Net/IHttpClient.cs35
1 files changed, 35 insertions, 0 deletions
diff --git a/MediaBrowser.Common/Net/IHttpClient.cs b/MediaBrowser.Common/Net/IHttpClient.cs
index d02f08572..cec3ccff2 100644
--- a/MediaBrowser.Common/Net/IHttpClient.cs
+++ b/MediaBrowser.Common/Net/IHttpClient.cs
@@ -22,6 +22,14 @@ namespace MediaBrowser.Common.Net
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>
/// Performs a POST request
/// </summary>
/// <param name="url">The URL.</param>
@@ -34,6 +42,15 @@ namespace MediaBrowser.Common.Net
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>
/// Downloads the contents of a given url into a temporary location
/// </summary>
/// <param name="url">The URL.</param>
@@ -47,6 +64,16 @@ namespace MediaBrowser.Common.Net
Task<string> GetTempFile(string url, SemaphoreSlim resourcePool, CancellationToken cancellationToken, IProgress<double> progress, string userAgent = null);
/// <summary>
+ /// Gets the temp file.
+ /// </summary>
+ /// <param name="url">The URL.</param>
+ /// <param name="cancellationToken">The cancellation token.</param>
+ /// <param name="progress">The progress.</param>
+ /// <param name="userAgent">The user agent.</param>
+ /// <returns>Task{System.String}.</returns>
+ Task<string> GetTempFile(string url, CancellationToken cancellationToken, IProgress<double> progress, string userAgent = null);
+
+ /// <summary>
/// Downloads the contents of a given url into a MemoryStream
/// </summary>
/// <param name="url">The URL.</param>
@@ -55,5 +82,13 @@ namespace MediaBrowser.Common.Net
/// <returns>Task{MemoryStream}.</returns>
/// <exception cref="MediaBrowser.Model.Net.HttpException"></exception>
Task<MemoryStream> GetMemoryStream(string url, SemaphoreSlim resourcePool, CancellationToken cancellationToken);
+
+ /// <summary>
+ /// Gets the memory stream.
+ /// </summary>
+ /// <param name="url">The URL.</param>
+ /// <param name="cancellationToken">The cancellation token.</param>
+ /// <returns>Task{MemoryStream}.</returns>
+ Task<MemoryStream> GetMemoryStream(string url, CancellationToken cancellationToken);
}
} \ No newline at end of file