Can anyone tell me how to solve this problem?
This is my main page cs file: MainPage.cs
public MainPage()
{
InitializeComponent();
GetAccount();
}
async void GetAccount()
{
HttpClientHandler clientHandler = new HttpClientHandler();
clientHandler.ServerCertificateCustomValidationCallback = (sender, cert, chain, sslPolicyErrors) => { return true; };
// Pass the handler to httpclient(from you are calling api)
HttpClient httpClient = new HttpClient(clientHandler);
httpClient.Timeout = TimeSpan.FromMinutes(30);
var api = "https://localhost:xxxxx/API/Accounts";//web api
var response = await httpClient.GetStringAsync(api);//The error showed this line got problem
var user = JsonConvert.DeserializeObject<List<Account>>(response);
US.ItemsSource = user;
}