RESTCLIENT.NET / API REFERENCE
RestClient.Net.PostAsync<TSuccess, TError, TRequest>
All API types · RestClient.Net · View source
public delegate Task<Result<TSuccess, HttpError<TError>>> PostAsync<TSuccess, TError, TRequest>(HttpClient httpClient, TRequest requestBody, CancellationToken cancellationToken = default);
Delegate for executing POST requests that return a Result with typed success and error responses.
| Parameter | Type | Default | Description |
|---|---|---|---|
httpClient |
HttpClient |
Required | The HttpClient to use for the request. |
requestBody |
TRequest |
Required | The request body content. |
cancellationToken |
CancellationToken |
default |
Cancellation token to cancel the request. |
Type parameter TSuccess: The type of the success response body.
Type parameter TError: The type of the error response body.
Type parameter TRequest: The type of the request body.
Returns: A Result containing either the success response or an HttpError with the error response.