RESTCLIENT.NET / API REFERENCE
RestClient.Net.HttpAction
All API types · RestClient.Net · View source
public delegate Task<HttpResponseMessage> HttpAction(HttpClient httpClient, HttpRequestMessage requestMessage, CancellationToken cancellationToken);
Represents an asynchronous HTTP operation that sends a request and returns a response. This delegate encapsulates the core functionality of executing HTTP requests with support for optional request content, headers, and cancellation.
| Parameter | Type | Default | Description |
|---|---|---|---|
httpClient |
HttpClient |
Required | The HTTP client to use for sending the request. |
requestMessage |
HttpRequestMessage |
Required | The request message to send. |
cancellationToken |
CancellationToken |
Required | Cancellation token to cancel the operation. |
Returns: A task that represents the asynchronous operation, containing the HTTP response message.