RESTCLIENT.NET / API REFERENCE
RestClient.Net.GetAsync<TSuccess, TError, TParam>
All API types · RestClient.Net · View source
public delegate Task<Result<TSuccess, HttpError<TError>>> GetAsync<TSuccess, TError, TParam>(HttpClient httpClient, TParam parameters, CancellationToken cancellationToken = default);
Delegate for executing GET 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. |
parameters |
TParam |
Required | The parameters used to construct the request URL. |
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 TParam: The type of the parameter used to construct the request URL.
Returns: A Result containing either the success response or an HttpError with the error response.