2

I have a working console app, which sends data to an API. However as soon as I launch fiddler, I get the message:

[Fiddler] ReadResponse() failed: The server did not return a complete response for this request. Server returned 257 bytes.

The first header shown in Fiddler is: HTTP/1.1 504 Fiddler - Receive Failure which seems to be generated directly by fiddler rather than having come from my API server (.NET).

How can I debug why this is happening, given that fiddler will not show me the raw results from the server? I presume there is an HTTP header error of some sort, which is compatible with my console app but not compatible with Fiddler.

I have been playing with gzip compressed requests, so perhaps one of the headers is incorrect (Content-Length), but with no way to view the raw response, it's very hard to debug this problem.

NickG
  • 9,315
  • 16
  • 75
  • 115

2 Answers2

6

In the end I got some help from @ErikLaw on this:

  1. Download DebugView https://learn.microsoft.com/en-us/sysinternals/downloads/debugview
  2. In Fiddler's black QuickExec box under the session list, type !spew and hit Enter. Fiddler will begin spewing verbose logging information to DebugView, including all reads and writes to/from the network.

Far more information about the failed request is then shown in DebugView, which led me to the root cause that my web server was closing the connection early, before sending all content.

All credit to Eric.

NickG
  • 9,315
  • 16
  • 75
  • 115
  • That is outstanding, NickG! Thank you for sharing this. And yes, thanks to Eric for marvelous tool! – Alex Aug 04 '20 at 13:57
1

How can I debug why this is happening, given that fiddler will not show me the raw results from the server?

Use Wireshark to see the actual network traffic. Fiddler's good (it's great), but it's not Wireshark. You'll need to jump through some hoops if your traffic is HTTPS, though.

Wireshark is not as easy to use as Fiddler, but it is significantly more powerful.

Also, if you're on Windows, you need to use your machine's local network IP address (e.g. 192.168.x.y), rather than localhost. See this question.

Roger Lipscombe
  • 89,048
  • 55
  • 235
  • 380
  • I tried WireShark before posting, but it seems to have a steep learning curve and I couldn't see my (localhost) traffic in the logs at all. – NickG Jan 18 '18 at 12:57