How do I see the raw HTTP request that the HttpWebRequest class sends?

后端 未结 8 701
伪装坚强ぢ
伪装坚强ぢ 2020-11-29 01:19

I know you are all going to answer \"use a debugging proxy server like Fiddler\" but it\'s not that simple.

Here\'s my situation: I have some code that runs on a ser

8条回答
  •  不知归路
    2020-11-29 01:23

    answering my own question here, because I thought of another way to do it. Basically the idea is -- you re-point the HttpWebRequest to a page that logs the incoming raw HTTP Request. In other words set up a custom HTTP handler as per this forum post:

    http://forums.asp.net/t/353955.aspx

    And then change just the URL in the HttpWebRequest to point to this new endpoint, but keep all other elements of the request the same. Write the result to a file or something and you're golden.

提交回复
热议问题