Skip to content

DurableIdempotencyKeyHandler Methods

Adds an Idempotency-Key header which identifies the running durable task to each request that a durable task sends, so every attempt and replay of the task sends the same key.

Send(HttpRequestMessage, CancellationToken)

override
View source
protected override HttpResponseMessage Send(HttpRequestMessage request, CancellationToken cancellationToken)
Sends an HTTP request to the inner handler to send to the server.

Parameters

requestHttpRequestMessage
The HTTP request message to send to the server.
cancellationTokenCancellationToken
A cancellation token to cancel operation.

Returns

An HTTP response message.

Exceptions

System.OperationCanceledException
The cancellation token was canceled. This exception is stored into the returned task.

SendAsync(HttpRequestMessage, CancellationToken)

override
View source
protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
Sends an HTTP request to the inner handler to send to the server as an asynchronous operation.

Parameters

requestHttpRequestMessage
The HTTP request message to send to the server.
cancellationTokenCancellationToken
A cancellation token to cancel operation.

Returns

The task object representing the asynchronous operation.

Exceptions

System.ArgumentNullException
The request was null.
System.OperationCanceledException
The cancellation token was canceled. This exception is stored into the returned task.