title: How Could I Use Contentlength, GetResponse, or GetRequestStream In A UWP App (C#)
body: <p>I know C# but am new to UWP... I have noticed that some <code>HttpWebRequest</code> definitions are non existent in UWP. How would I be able to use <code>ContentLength</code>, <code>GetRequestStream</code>, and <code>GetResponse</code> in a UWP application? Thanks. Here is my code if needed:</p>
  
  <pre><code>HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(SelectedItem + url);
  webRequest.Headers.Add("SOAPACTION", SOAPACTION);
  webRequest.Method = "POST";
  webRequest.ContinueTimeout = 2000;
  webRequest.ContentType = "text/xml";
  
  string postData = xmlData;
  byte[] byteArray = Encoding.UTF8.GetBytes(postData);
  webRequest.ContentLength = byteArray.Length;
  
  Stream dataStream = webRequest.GetRequestStream();
  dataStream.Write(byteArray, 0, byteArray.Length);
  dataStream.Dispose();
  
  WebResponse response = webRequest.GetResponse();
  dataStream = response.GetResponseStream();
  StreamReader reader = new StreamReader(dataStream);
  string responseFromServer = reader.ReadToEnd();
  
  reader.Dispose();
  response.Dispose();
  return responseFromServer;
  </code></pre>