aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.ApiInteraction/IAsyncHttpClient.cs
diff options
context:
space:
mode:
authorLukePulverenti <luke.pulverenti@gmail.com>2013-02-20 20:33:05 -0500
committerLukePulverenti <luke.pulverenti@gmail.com>2013-02-20 20:33:05 -0500
commit767cdc1f6f6a63ce997fc9476911e2c361f9d402 (patch)
tree49add55976f895441167c66cfa95e5c7688d18ce /MediaBrowser.ApiInteraction/IAsyncHttpClient.cs
parent845554722efaed872948a9e0f7202e3ef52f1b6e (diff)
Pushing missing changes
Diffstat (limited to 'MediaBrowser.ApiInteraction/IAsyncHttpClient.cs')
-rw-r--r--MediaBrowser.ApiInteraction/IAsyncHttpClient.cs49
1 files changed, 49 insertions, 0 deletions
diff --git a/MediaBrowser.ApiInteraction/IAsyncHttpClient.cs b/MediaBrowser.ApiInteraction/IAsyncHttpClient.cs
new file mode 100644
index 000000000..edd11829a
--- /dev/null
+++ b/MediaBrowser.ApiInteraction/IAsyncHttpClient.cs
@@ -0,0 +1,49 @@
+using MediaBrowser.Model.Logging;
+using System;
+using System.IO;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace MediaBrowser.ApiInteraction
+{
+ /// <summary>
+ /// Interface IHttpClient
+ /// </summary>
+ public interface IAsyncHttpClient : IDisposable
+ {
+ /// <summary>
+ /// Sets the authorization header that should be supplied on every request
+ /// </summary>
+ /// <param name="header"></param>
+ void SetAuthorizationHeader(string header);
+
+ /// <summary>
+ /// Gets the stream async.
+ /// </summary>
+ /// <param name="url">The URL.</param>
+ /// <param name="logger">The logger.</param>
+ /// <param name="cancellationToken">The cancellation token.</param>
+ /// <returns>Task{Stream}.</returns>
+ Task<Stream> GetStreamAsync(string url, ILogger logger, CancellationToken cancellationToken);
+
+ /// <summary>
+ /// Deletes the async.
+ /// </summary>
+ /// <param name="url">The URL.</param>
+ /// <param name="logger">The logger.</param>
+ /// <param name="cancellationToken">The cancellation token.</param>
+ /// <returns>Task.</returns>
+ Task DeleteAsync(string url, ILogger logger, CancellationToken cancellationToken);
+
+ /// <summary>
+ /// Posts the async.
+ /// </summary>
+ /// <param name="url">The URL.</param>
+ /// <param name="contentType">Type of the content.</param>
+ /// <param name="postContent">Content of the post.</param>
+ /// <param name="logger">The logger.</param>
+ /// <param name="cancellationToken">The cancellation token.</param>
+ /// <returns>Task{Stream}.</returns>
+ Task<Stream> PostAsync(string url, string contentType, string postContent, ILogger logger, CancellationToken cancellationToken);
+ }
+}