I am working on xamarin forms. Where I am consuming the API. When I am running the app in android 5 it is working fine but If I am running 7 + it is giving the error like
Unable to resolve host "almsdev.southeastasia.cloudapp.azure.com": No address associated with hostname.
How to resolve this?
Following is the code snippet:
public async Task<HttpResponseMessage> Login(string EmailOrMobile)
{
try
{
var responseTask = await client.GetAsync(OauthBaseUrl + "OAuthSAAS/MSLogin?UserCredentials=" + EmailOrMobile);
return responseTask;
}
catch (Exception ex)
{
Crashes.TrackError(ex);
return null;
}
}
On button click I am calling above method
private async void fn_Submit_Clicked(object sender, EventArgs e)
{
var response = await _oauthService.Login(txt_credentails.Text.Trim());
}
My Base URL is
http://almsdev.southeastasia.cloudapp.azure.com:81/api/
I am using Http client = new Http();