我有一个非常简单的应用程序,它发送一个HttpWebRequest并获得响应。我需要知道发送到服务器的确切请求。有可能吗?
这样的事情:
POST /path/script.cgi HTTP/1.0
From: frog@jmarshall.com
User-Agent: HTTPTool/1.0
Content-Type: application/x-www-form-urlencoded
Content-Length: 32
答案 0 :(得分:0)
使用System.Net.Sockets.TcpListener构建基本Web服务器。该示例显示了如何执行此操作。然后,将您的HttpWebRequest指向该服务器并查看结果。