title: Using HTTP GET Method to Retrieve PHP script
body: <p><em>(I'm a beginner. This is to understand PHP better.)</em></p>
  
  <p>While experimenting with HTTP I was trying to <code>GET</code> a PHP-file from my server and I didn't get anything. Neither the HTTP-Header <code>Content-Length</code> nor any content is available for reading in the response.</p>
  
  <pre><code>string url = "http://php.net/sites.php";
  HttpWebRequest request = (HttpWebRequest) WebRequest.Create(url);
  request.AutomaticDecompression = DecompressionMethods.GZip;
  request.Method = "GET";
  Stream stream = request.GetRequestStream(); // "ProtocolViolationException" is thrown here
  StreamWriter writer = new StreamWriter(stream);
  writer.WriteLine("test 3");
  </code></pre>
  
  <p>So with that C# code above and with my local IIS i can't GET any php files right? I can GET only html, js, css, images and a few_other right? What I found out as well is if I want the PHP script to be executed I need to change "GET" to "POST" and then I will be getting the PHP output.</p>
  
  <p><strong>What I would like to understand:</strong></p>
  
  <ul>
  <li>There is no way for me with common Web-Servers to retrieve PHP code?</li>
  <li>Webbrowsers do POST-requests automatically when retrieving php output?</li>
  <li>Why is it like this?</li>
  </ul>
  
  <p><em>FYI: (not important here) I have to write C# app later that is going to communicate to a WebServer to retrieve some data and do actions that Webbrowsers can't do.</em></p>