The
IRestRequest
doesn't contain any methods for executing a request. You will need an
IRestClient
instance for that.
private static IRestResponse executeAPI(IRestClient client, string httpMethod, IRestRequest request, string basePath)
{
Method method;
if (!Enum.TryParse(httpMethod, out method))
{
throw new ArgumentException("Invalid HTTP method.", nameof(httpMethod));
}
request.Method = method;
request.Resource = basePath;
return client.Execute(request);
}