Prior to 106.10.1, following code returns a Task<IRestResponse>
Client.ExecuteTaskAsync(request);
Now that 106.10.1 has marked ExecuteTaskAsync as obsolete, following code is expected to also return Task<IRestResponse>
Client.ExecuteAsync(request);
Instead, following code produces a compilation error:
Client.ExecuteAsync(request);
Error CS0411 The type arguments for method 'IRestClient.ExecuteAsync<T>(IRestRequest, CancellationToken)
' cannot be inferred from the usage. Try specifying the type arguments explicitly.
I have found that following code does compile and returns Task<IRestResponse>
Client.ExecuteAsync(request, request.Method);
Just yesterday I changed all the tests to use ExecuteAsync where ExecuteTaskAsync was previously used. There were no problems with compiling the code.
Can you provide more code?
Can confirm. There used to be an interface definition
IRestClient.ExecuteTaskAsync(IRestRequest)
, but in v106.10.1 this is marked as obsolete by IRestClient.ExecuteAsync
.
However, there is no direct replacement for the IRestClient.ExecuteTaskAsync(IRestRequest)
interface method. The closest one is IRestClient.ExecuteTaskAsync(IRestRequest, Method)
as stricq mentions, where you also have to specify the HTTP Method.
This isn't a big deal, but if the method is already a part of the request, surely having an interface definition that reads it from the request makes sense? Especially since it was defined that way in the now obsoleted method 😃
I found the issue. The ExecuteAsync
non-generic overload that returns IRestRequest
is not a part of the interface, but it is available on the RestClient
. I already fixed it locally.
Any estimate for the next release time?
Closing because of the latest release.
Most helpful comment
I found the issue. The
ExecuteAsync
non-generic overload that returnsIRestRequest
is not a part of the interface, but it is available on theRestClient
. I already fixed it locally.