我需要测试一些我编写的客户端应用程序代码,以测试它对来自Web服务器的HTTP响应中返回的各种状态代码的处理。
I need to test some client application code I've written to test its' handling of various status codes returned in an HTTP response from a web server.
I安装了Fiddler 2(Web调试代理),我相信有一种方法可以使用这个应用程序修改响应,但我很难找到方法。这将是最方便的方式,因为它允许我保持客户端和服务器代码不被修改。
I have Fiddler 2 (Web Debugging Proxy) installed and I believe there's a way to modify responses using this application, but I'm struggling to find out how. This would be the most convenient way, as it would allow me to leave both client and server code unmodified.
任何人都可以协助,因为我想拦截HTTP响应从服务器发送到客户端并在到达客户端之前修改状态代码?
Can anyone assist as I'd like to intercept the HTTP response being sent from server to client and modify the status code before it reaches the client?
任何建议都将不胜感激。
Any advice would be much appreciated.
推荐答案好的,所以我假设你已经能够监控你的客户端/服务器流量了。您要做的是在响应上设置一个断点,然后在将其发送到客户端之前摆弄它。
Ok, so I assume that you're already able to monitor your client/server traffic. What you want to do is set a breakpoint on the response then fiddle with it before sending it on to the client.
以下是几种不同的方法:
Here are a couple of different ways to do that:
一旦你在断点处停止了响应,只需双击它就可以在检查员中打开它。你现在有几个选择:
Once you've got a response stopped at the breakpoint, just double click it to open it in the inspectors. You've got a couple of options now:
更多推荐
如何使用Fiddler修改HTTP响应中的状态代码?
发布评论