I\'m attempting to use the documentation on the RestSharp GitHub wiki to implement calls to my REST API service but I\'m having an issue with the ExecuteAsync method in part
As an alternative (or complement) to the fine answer by Gusten. You can use ExecuteTaskAsync. This way you do not manually have to handle TaskCompletionSource. Note the async keyword in the signature.
public async Task ExecuteAsync(RestRequest request) where T : new()
{
var client = new RestClient();
client.BaseUrl = BaseUrl;
client.Authenticator = new HttpBasicAuthenticator(_accountSid, _secretKey);
request.AddParameter("AccountSid", _accountSid, ParameterType.UrlSegment);
IRestResponse response = await client.ExecuteTaskAsync(request);
return response.Data;
}