I'm connecting my Xamarin forms project to a simple ASP.NET Web API but once I call PostAsync, ObjectDisposedException is thrown.
This exception doesn't occur when I use UWP but it does when I use Android.
var client = new HttpClient();
var model = new RegisterBindingModel
{
Email = email,
Password = password,
ConfirmPassword = confirmPassword
};
var json = JsonConvert.SerializeObject(model);
HttpContent content = new StringContent(json);
content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
var response = await client.PostAsync("http://localhost:53490/api/Account/Register", content);
Any idea?