I'm working with RestSharp.NetCore package and have a need to call the ExecuteAsyncPost method. I'm struggling with the understanding the callback parameter.
var client = new RestClient("url");
request.AddParameter("application/json", "{myobject}", ParameterType.RequestBody);
client.ExecuteAsyncPost(request,**callback**, "POST");
The callback is of type Action<IRestResponse,RestRequestAsyncHandler>
Would someone please post a small code example showing how to use the callback parameter with an explanation.
Thanks -C
RestSharp v106 support .NET Standard 2.0 so if your code worked with RestSharp 105 under .NET Framework - it will also work with .NET Core 2.
RestSharp.NetCore
package is not from RestSharp team and is not supported by us. It is also not being updated and the owner does not respond on messages, neither the source code of the package is published.This worked for me using ExecuteAsync for a Get call. It should hopefully point you in the right direction. Note that the code and credit goes to https://www.learnhowtoprogram.com/net/apis-67c53b46-d070-4d2a-a264-cf23ee1d76d0/apis-with-mvc