xamarin web API authentication
<p>I am very new to Xamarin and mobile development and I am currently involved in developing a sample application with authentication. We are using our internal Web API service to authenticate and can someone guide me how to proceed in this case. I am planning to use MvvmCross framework in my development. I am NOT using Xamarin forms and using the platform specific project for Android as part of my initial development. Any help really appreciated.</p>

<p>Here is the sample code I am using to call my WebAPI</p>

<pre><code>public async Task&lt;HttpResponseMessage&gt; PutAsync&lt;T&gt;(string url,T content)
        {

             using (var client = new HttpClient(new NativeMessageHandler()))
          //  using (var client = new HttpClient())
            {
                string json = JsonConvert.SerializeObject(content);
                var address = string.Format("{0}{1}", WebService.BaseUrl, url);
                var httpContent = new StringContent(json, Encoding.UTF8, "application/json");
                var response = await client.PutAsync(new System.Uri(address), httpContent);
                return response;
            }
        }`enter code here`
</code></pre>

<blockquote>
  <p>I was able to call a sample get request using http but failing on </p>
  
  <blockquote>
    <p>https</p>
  </blockquote>
</blockquote>

<p>request. I am testing on android 4.4 Kit kat device</p>

<pre><code>System.Net.Http.HttpMessageHandler handler = new NativeMessageHandler(false,true);

.Net.Http.HttpClient client = (handler == null) ? new System.Net.Http.HttpClient() :new System.Net.Http.HttpClient(new NativeMessageHandler(false,true));
result = client.GetAsync("https://httpbin.org/ip");
                var stream = await result.Result.Content.ReadAsStringAsync();
</code></pre>