Files
2019-10-30 13:51:20 -03:00

31 lines
1.1 KiB
C#

using System;
using System.Threading;
using System.Threading.Tasks;
namespace Octokit.Internal
{
/// <summary>
/// Generic Http client. Useful for those who want to swap out System.Net.HttpClient with something else.
/// </summary>
/// <remarks>
/// Most folks won't ever need to swap this out. But if you're trying to run this on Windows Phone, you might.
/// </remarks>
public interface IHttpClient : IDisposable
{
/// <summary>
/// Sends the specified request and returns a response.
/// </summary>
/// <param name="request">A <see cref="IRequest"/> that represents the HTTP request</param>
/// <param name="cancellationToken">Used to cancel the request</param>
/// <returns>A <see cref="Task" /> of <see cref="IResponse"/></returns>
Task<IResponse> Send(IRequest request, CancellationToken cancellationToken);
/// <summary>
/// Set the GitHub API request timeout.
/// </summary>
/// <param name="timeout">The Timeout value</param>
void SetRequestTimeout(TimeSpan timeout);
}
}