title: C# read stream get WebException
body: <p>I'm trying to open a connection to a server and get the response body, which is an image. I want to save it to <code>Image</code>, and later display it in the <code>PictureBox</code>. Here is my code:</p>
  
  <pre><code>try
      {
          var response = WebRequest.Create(String.Format(url + "?t=webwx&amp;_={0}", timestamp));
          var stream = response.GetRequestStream();
          Image image = Image.FromStream(stream);
          qe_img.Image = image;
          qe_img.Height = image.Height;
          qe_img.Width = image.Width;
       } catch (Exception e)
       {
          Console.WriteLine(e);
       }
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>Exception thrown: 'System.Net.ProtocolViolationException' in System.dll
  System.Net.ProtocolViolationException: Cannot send a content-body with this verb-type.
     at System.Net.HttpWebRequest.CheckProtocol(Boolean onRequestStream)
     at System.Net.HttpWebRequest.GetRequestStream(TransportContext&amp; context)
     at System.Net.HttpWebRequest.GetRequestStream()
     at WindowsFormsApplication1.Form1.showQRImage() in c:\users\morgan\documents\visual studio 2015\Projects\WindowsFormsApplication1\WindowsFormsApplication1\Form1.cs:line 70
  </code></pre>
  
  <p>But I always get a <code>WebException</code>. I'm new to C#, I wonder what is wrong here. Thanks.</p>