So, I have an API running in Visual Studio 2019, and I can make a request by typing in a url in the browser, like
https://192.168.1.192:44327/api/pickslips
But when I try to make such a call from code, like for instance:
HttpClient httpClient = new HttpClient();
httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
var responseMessage = await httpClient.GetAsync(@"https://192.168.1.192:44327/api/pickslips");
var jsonResult = await responseMessage.Content.ReadAsStringAsync();
var slips = JsonConvert.DeserializeObject<IEnumerable<PickSlip>>(jsonResult);
return slips.ToList();
The application stops and exits at await GetAsync, without an error, and doesn't get to anything beyond it. However, the code works when I try to make a call to other APIs like some of the test ones you can find on the internet.
By the way, one of the reasons why it's not running on localhost is because I need it for Xamarin.
So how can I make this work?