Skip to content

Commit aa43b68

Browse files
Correct methods name (#2243)
1 parent fef25a5 commit aa43b68

File tree

1 file changed

+1
-1
lines changed
  • docs/versioned_docs/version-v111

1 file changed

+1
-1
lines changed

docs/versioned_docs/version-v111/intro.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ var timeline = await client.GetAsync<HomeTimeline>(request, cancellationToken);
6363
Both snippets above use the `GetAsync` extension, which is a wrapper about `ExecuteGetAsync`, which, in turn, is a wrapper around `ExecuteAsync`.
6464
All `ExecuteAsync` overloads and return the `RestResponse` or `RestResponse<T>`.
6565

66-
The most important difference is that async methods named after HTTP methods (like `GetAsync` or `PostAsync`) return `Task<T>` instead of `Task<RestResponse<T>>`. It means that you won't get an error response if the request fails as those methods throw an exception for unsuccessful HTTP calls. For keeping the API consistent, non-generic functions like `GetAsync` or `PostAsync` also throw an exception if the request fails, although they return the `Task<RestResponse>`.
66+
The most important difference is that async methods named after HTTP methods (like `GetAsync<T>` or `PostAsync<T>`) return `Task<T>` instead of `Task<RestResponse<T>>`. It means that you won't get an error response if the request fails as those methods throw an exception for unsuccessful HTTP calls. For keeping the API consistent, non-generic functions like `GetAsync` or `PostAsync` also throw an exception if the request fails, although they return the `Task<RestResponse>`.
6767

6868
Read [here](advanced/error-handling.md) about how RestSharp handles exceptions.
6969

0 commit comments

Comments
 (0)