# DurableHttpClientExtensions Methods

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.durable.http/orleans.durable.http.durablehttpclientextensions/)

## RunOperationAsync(IDurableHttpClient, Func&lt;HttpRequestMessage&gt;, DurableHttpOperationOptions?) {#runoperationasync-1-this-orleans-durable-http-idurablehttpclient-system-func-sys-b311fe2b}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.durable.http/orleans.durable.http.durablehttpclientextensions/methods/runoperationasync-1-this-orleans-durable-http-idurablehttpclient-system-func-sys-b311fe2b/)

[Source](https://github.com/dotnet/orleans/blob/4e887e9c914a2f2647fb3c81de963511521dd9cb/src/Orleans.Durable.Http/IDurableHttpClient.cs#L136-L138)

```csharp
public static DurableTask<TResult> RunOperationAsync<TResult>(this IDurableHttpClient client, Func<HttpRequestMessage> createRequest, DurableHttpOperationOptions? options = null)
```

Starts an operation with the request which `createRequest` creates, and durably waits for its result.

### Parameters

- `client` (`IDurableHttpClient`): The client.
- `createRequest` (`Func<HttpRequestMessage>`): Creates the request which starts the operation; it runs for each attempt of the start.
- `options` (`DurableHttpOperationOptions?`): Configures the wait, or `null` for the defaults.

### Returns

A durable task which returns the operation's result.

### Exceptions

- `Orleans.Durable.Http.DurableHttpOperationException`: The operation failed or was canceled.
- `System.Net.Http.HttpRequestException`: A response reports neither an operation nor a result.
