I'm trying out RestSharp with C# and I'm just trying to get a real simple request to work. I have the following super simple request to a public REST API. When I run this, I can put a break point right on the line where I set the response to the .GetAsync call. When I try to move on past this which is calling the .GetAysnc, nothing happens and my console app stops processing. It does not drop down into the Catch
part of the Try...Catch so I'm not seeing any errors. Any suggestions on what I'm doing wrong?
try
{
var testURL = "https://dog.ceo/api/breeds/list/all";
var client = new RestClient(testURL);
var request = new RestRequest();
var response = await client.GetAsync(request);
}
catch (Exception ex)
{
_log.LogError("Error getting Data. {0} | {1} | {2}", ex.Message, ex.StackTrace, ex.InnerException);
}