I have a class that is posting to an API which is working in my unit tests but not my MVC controller.
In the tester the following line works just fine but when call it in my MVC application I cannot step beyond the following line.
public async Task<string> post( object values )
{
using (var client = new HttpClient())
{
try
{
var responseString = await address.PostJsonAsync(values).ReceiveString();
return responseString; //Never reaches this line while in MVC.
}
catch (Exception e)
{
//Console.Error.WriteLine(e.Message);
return "";
}
}
}