title: 'System.Net.HttpWebRequest' does not contain a definition for 'GetRequestStream'
body: <p>I am new to both C# and Windows phone and am trying to make a small app that performs a JSON request. I am following the example in this post <a href="https://stackoverflow.com/a/4988809/702638">https://stackoverflow.com/a/4988809/702638</a></p>
  
  <p>My current code is this:</p>
  
  <pre><code>public string login()
  {
      var httpWebRequest = (HttpWebRequest)WebRequest.Create(MY_URL);
      httpWebRequest.ContentType = "text/plain"; 
      httpWebRequest.Method      = "POST";
  
      using (var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream()))
      {
         string text = MY_JSON_STRING;
         streamWriter.Write(text);
      }
  }
  </code></pre>
  
  <p>but for some reason Visual Studio is flagging <code>GetRequestStream()</code> with an error message:</p>
  
  <blockquote>
    <p>error CS1061: 'System.Net.HttpWebRequest' does not contain a
    definition for 'GetRequestStream' and no extension method
    'GetRequestStream' accepting a first argument of type
    'System.Net.HttpWebRequest' could be found (are you missing a using
    directive or an assembly reference?)</p>
  </blockquote>
  
  <p>Any thoughts on why this would be happening? I have already imported the <code>System.Net</code> package.</p>