Httpwebrequest and Post C# with Fiddler Probs RRS feed

  • Question

  • User-635868674 posted

    Hi Guys,

    I have been absolutely banging my head against the wall on this problem.

    Basically, I am using C# and httpwebrequest to do a HTTPS call to a website to login and get a report.

    The steps basically are:

    1-3) login, get urls for login and report. 

    Step 4) once logged in - get report. 

    The problem I am having relates specifically to Step 4 such that it works - but only when fiddler is running.

    When Fiddler isn't running I get a remote timeout exception for Step 4 - FinalStepGetReportData()

    The post and some code is below. I have tried putting the website in IE Trusted Sites - but still get the exception.

    Would any here be able to help ? I am at a complete loss as how to fix this.

    Thanks so much

    Wednesday, June 24, 2009 1:11 AM

All replies

  • User-1471482529 posted

     You could try disabling the Fiddler "hook" browser add in via the tools menu (in IE or Firefox). Since Fiddler is a proxy, it could contribute to a timeout issue.

    Friday, July 24, 2009 4:22 PM
  • User-1524143065 posted

    Andy, I've been having the same problem and saw your post all over the internet ... I stumbled across this link ... Fiddler must force open and closed the requests, since it's acting as a proxy.

    Calling the close() method or wrapping in a using statement appears to be working in my case. 

    HttpWebRequest testRequest = (HttpWebRequest)WebRequest.Create("http://.....");
    string responseStatus;
    using (HttpWebResponse testResponse = (HttpWebResponse)testRequest.GetResponse())
         responseStatus = testResponse.StatusCode.ToString();


    HttpWebRequest testRequest = (HttpWebRequest)WebRequest.Create("http://.....");
    HttpWebResponse testResponse = (HttpWebResponse)testRequest.GetResponse();
    string responseStatus = testResponse.StatusCode.ToString();

    Hope this helps.

    Tuesday, August 25, 2009 1:49 PM