title: Windows-Universal https Post Xamarin Forms
body: <p>I want to make a Json Post Request with my Windows Universal App.
  I have it working in my Android and IOS.</p>
  
  <pre><code>   public String DoServiceCall()
      {
          var request = (HttpWebRequest)WebRequest.Create(string.Format("{2}/{0}/{0}ServiceJson.svc/{1}", "Authentication", "Authenticate", "https://....."));
  
          using (MemoryStream ms = new MemoryStream())
          {
              // create the request object
              string requestString = JSONRequest;
              byte[] requestData = Encoding.UTF8.GetBytes(requestString);
              request.Method = "POST";
              request.ContentType = "application/json; charset=UTF-8";
              request.ContentLength = requestData.Length;
              request.AllowAutoRedirect = false;
  
              // add known cookies to request (needed for authentication)
              CookieContainer requestCookies = new CookieContainer();
              foreach (Cookie knownCookie in this._cookieCollection)
              {
                  requestCookies.Add( knownCookie);
              }
              request.CookieContainer = requestCookies;
  
              //For getting rid of the https Problem
              ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, sslPolicyErrors) =&gt; true;
  
              using (Stream stream =  request.GetRequestStream())
              {
                  stream.Write(requestData, 0, requestData.Length);
              }
              // get response data
              HttpWebResponse response = (HttpWebResponse) request.GetResponse();
  
              string responseString = new StreamReader(response.GetResponseStream()).ReadToEnd();
              return (responseString);
          }
      }
  </code></pre>
  
  <p>The Problem is that Windows Universal does not support.</p>
  
  <pre><code>request.ContentLength = requestData.Length;
  request.AllowAutoRedirect = false;
  requestCookies.Add( knownCookie); //with only one Argument
  ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, sslPolicyErrors) =&gt; true;
  </code></pre>
  
  <p>Neither does it support. </p>
  
  <pre><code>request.GetRequestStream())
  (HttpWebResponse) request.GetResponse();
  </code></pre>
  
  <p>But that i could fix with async</p>
  
  <pre><code>await request.GetRequestStreamAsync())
  (HttpWebResponse)await request.GetResponseAsync();
  </code></pre>
  
  <p>But without that 4 Lines i couldn´t get it working on Windows.
  I just doesn´t get any Response.
  Is there an Option to get it working on Windows 10 or is there an Working alternative.</p>