SendHttpRequestWithRetryAsync(Func<HttpRequestMessage>, int) Method
Sends an HttpRequestMessage with exponential back-off.

Syntax

public Task<HttpResponseMessage> SendHttpRequestWithRetryAsync(Func<HttpRequestMessage> requestFactory, int retryCount)

Parameters

Name Type Description
requestFactory Func<HttpRequestMessage> A factory that creates the request message to send (a fresh message is needed for each request).
retryCount int The number of times to retry.

Return Value

Type Description
Task<HttpResponseMessage> The response.