Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Calling Web API's In Xamarin Forms

$
0
0

I'm a newbie to Xamarin and i try to learn how to call Web API's from Xamarin Forms. I was trying to run this example https://docs.microsoft.com/en-us/samples/xamarin/xamarin-forms-samples/webservices-todorest/ , at my Android Phone(Visual Studio Debugger), but i am getting a System.NotImplementedException in this methode:
[assembly: Dependency(typeof(HttpClientHandlerService))]
namespace TodoREST.Droid
{
public class HttpClientHandlerService : IHttpClientHandlerService
{
public HttpClientHandler GetInsecureHandler()
{
HttpClientHandler handler = new HttpClientHandler();
handler.ServerCertificateCustomValidationCallback = (message, cert, chain, errors) =>
{
if (cert.Issuer.Equals("CN=localhost"))
return true;
return errors == System.Net.Security.SslPolicyErrors.None;
};
return handler;
}
}
}

The exception occurs at this line:
handler.ServerCertificateCustomValidationCallback = (message, cert, chain, errors) =>
{
if (cert.Issuer.Equals("CN=localhost"))
return true;
return errors == System.Net.Security.SslPolicyErrors.None;
};

Can anyone help me with this?

Thanks in advance.


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>