Connect to API Services From Xamarin form my android device . I have got a connection error (Connection refused)
"Your application "
public async Task RegisterAsync(string userName, string email, string password, string confirmPassword)
{
var client = new HttpClient();
var model = new RegisterBindingModel
{
UserName = userName,
Email = email,
Password = password,
ConfirmPassword = confirmPassword
};
var json = JsonConvert.SerializeObject(model);
HttpContent httpContent = new StringContent(json);
httpContent.Headers.ContentType = new MediaTypeHeaderValue("Application/json");
var response = await client.PostAsync("http://localhost:64111/api/account/register", httpContent);
bool req;
if (response.IsSuccessStatusCode)
{
req = true;
}
else
{
req = false;
}
return response.IsSuccessStatusCode;
}