Search code examples
c#.nethttpwebrequestfiddler

Fiddler makes HttpWebRequest/HttpClient behaviour unexpected


Just wanted to ask if somebody encountered a problem of using HttpWebRequest class (or even new HttpClient) when trying upload some file to the server when Fiddler is launched.

I have encountered the bug, namely, AllowWriteStreamBuffering property of HttpWebRequest class is not working when the fiddler is launched, so upload progress is not working at all. Bytes are not sent instantly but buffored even if I set AllowWriteStreamBuffering to true, therefore I can't track upload progress. It is works ok when fiddler is not launched.

Moreover if I close fiddler when my application is uploading some file, it will crash too throwing WebException which says "The underlying connection was closed: An unexpected error occurred on a receive."

The same things is happening with new .net 4.5 HttpClient class.


Solution

  • Sorry for the confusion; Fiddler currently only supports streaming of responses and not requests.

    Some proxies (like Fiddler) or other intermediaries will fully buffer a request before sending it to the server for performance or functional (e.g. virus scanning, breakpoint debugging) reasons.

    http://www.fiddler2.com/fiddler/help/streaming.asp