Retries a GET request with exponential back-off. This helps with websites like GitHub that will give us a 429 (TooManyRequests).
Syntax
public static Task<HttpResponseMessage> SendWithRetryAsync(this HttpClient httpClient, string uri, int retryCount, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Name |
Type |
Description |
httpClient |
HttpClient |
The client. |
uri |
string |
The request URI. |
retryCount |
int |
The number of times to retry. |
cancellationToken |
CancellationToken |
A cancellation token. |
Return Value
Type |
Description |
Task<HttpResponseMessage> |
The response. |