title: HttpWebRequest using GET on redirect instead of POST like idHttp
body: <p>Sorry for my english.</p>
  
  <p>In Delphi I have an idHttp component with the hoWaitForUnexpectedData option activated.</p>
  
  <p>When I send a POST request to a URL, it redirects the client to a second URL with the same POST request and headers. Also, the server response contains "Connection: keep-alive" in its header.</p>
  
  <p>However, when I try to do the same request in C# with a HttpWebRequest component, it redirects to the second URL using the method GET.</p>
  
  <p>I need the C# HttpWebRequest component to work like the Delphi idHTTP one does. I don't understand why it uses a GET instead of a POST when following the redirection.</p>
  
  <p>Here's my code in Delphi, using hoWaitForUnexpectedData:</p>
  
  <pre><code>  // The server is supposed to send a 'Content-Length' header without sending
    // the actual data. 1xx, 204, and 304 replies are not supposed to contain
    // entity bodies, either...
    if TextIsSame(ARequest.Method, Id_HTTPMethodHead) or
       TextIsSame(ARequest.MethodOverride, Id_HTTPMethodHead) or
       ((AResponse.ResponseCode div 100) = 1) or
       (AResponse.ResponseCode = 204) or
       (AResponse.ResponseCode = 304) then
    begin
      // Have noticed one case where a non-conforming server did send an
      // entity body in response to a HEAD request.  If requested, ignore
      // anything the server may send by accident
      if not (hoWaitForUnexpectedData in FOptions) then begin
        Exit;
      end;
      Result := CheckForPendingData(100);
    end
    else if (AResponse.ResponseCode div 100) = 3 then
    begin
      // This is a workaround for buggy HTTP 1.1 servers which
      // does not return any body with 302 response code
      Result := CheckForPendingData(5000);
    end else begin
      Result := True;
    end;
  </code></pre>