Extension method for IHttpClient

To not require cancellation token
This commit is contained in:
Amy Palamountain
2014-03-03 15:23:41 +13:00
parent 9409429033
commit 4f1f7e6629
2 changed files with 18 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
using System.Threading;
using System.Threading.Tasks;
using Octokit.Internal;
namespace Octokit
{
public static class HttpClientExtensions
{
public static Task<IResponse<T>> Send<T>(this IHttpClient httpClient, IRequest request)
{
Ensure.ArgumentNotNull(httpClient, "httpClient");
Ensure.ArgumentNotNull(request, "request");
return httpClient.Send<T>(request, CancellationToken.None);
}
}
}