本文介绍了如何使用fiddler或任何其他工具跟踪HttpClient请求?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我使用HttpClient发送请求给我没有访问的Web API服务之一,我需要跟踪从客户端到服务器的实际请求流。 有一种方法我可以连接Fiddler来听请求吗?I am using HttpClient for sending out request to one of the web api service that I don't have access to and I need to trace the actual request stream getting to the server from my client.Is there a way I can hookup the Fiddler to listen to the requests?我使用System.Net.Http.HttpClient类发送请求。I am using the System.Net.Http.HttpClient class for sending out request.更新:试图改善这个问题,因为我不能得到我想要的。 我使用.Net客户端应用程序连接到在我自己的IIS上通过HTTP通道托管的Web服务。我已经做了提琴调试早期与我的IIS托管的网站,并观看我的浏览器和WebSite之间产生的流量。但是,当涉及到观察由.Net客户端程序生成的流量,使用HttpClient类与Web服务通信时,奇怪的是,提琴手似乎无法点击该流量,并且不显示任何内容。 .Net HttpClient是否绕过WinInet API连接到服务,导致fiddler无法观看流量?Update: trying to improve this question now as I could not get what I was looking for.I am using a .Net Client application to connect to a Web Service hosted on my own IIS over HTTP channel. I have done the fiddler debugging earlier with a Website hosted on my IIS and watching the traffic generated between my browser and the WebSite. But when it comes to watching the traffic generated by a .Net client program talking to the web service using HttpClient class, strangely the fiddler does not seem to be able to tap that traffic and does not show anything. Is .Net HttpClient bypassing the WinInet API to connect to the service which results in the fiddler not able to watch the traffic?推荐答案一般来说,在您的应用程序足够之前,只需启动Fiddler。Generally speaking, simply starting Fiddler before your application is sufficient. You haven't explained what you've tried so far. 如果它不能正常工作,请阅读: http://fiddlerbook.com/fiddler/help/hookup.asp#Q-DOTNET li> 如果您的目标网址为localhost或127.0.0.1,请阅读: http://fiddlerbook.com/fiddler/help/hookup.asp#Q-LocalTraffic 如果您的代码在IIS或ASP.NET中运行,请阅读: http://fiddlerbook.com/fiddler/help/hookup.asp#Q-IISIf it doesn't just work, read:http://fiddlerbook.com/fiddler/help/hookup.asp#Q-DOTNETIf your target URL is localhost or 127.0.0.1, read:http://fiddlerbook.com/fiddler/help/hookup.asp#Q-LocalTrafficIf your code is running in IIS or ASP.NET, read:http://fiddlerbook.com/fiddler/help/hookup.asp#Q-IIS 这篇关于如何使用fiddler或任何其他工具跟踪HttpClient请求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
07-18 13:33