如何在Fiddler中修改请求? [英] How to modify a request in Fiddler?

查看:1146
本文介绍了如何在Fiddler中修改请求?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种简单的方法来拦截网页请求并使用 Fiddler 修改请求的内容(主要是 POST )。

I'm looking for a simple way to intercept a web request and modify the contents of the request (mainly POSTs) using Fiddler.

这是测试服务器端验证。

This is to test server-side validation.

我必须使用 Fiddler ,但是我没有找到一个很好的简单方法。

I have to use Fiddler, however I haven't found a good simple way to do so.

有几种记录的方法来编写脚本来拦截流量并且更改标题,但我想在不编写脚本的情况下执行此操作 - 测试人员需要使用此工具,并且不同测试人员一直在编写/修改脚本可能会很烦人。

There have been several documented ways to write scripts to intercept traffic and change headers, but I would like to do it without writing a script - this tool needs to be used by the testers and writing/modifying scripts all the time by different testers may be annoying.

示例:

带2个参数的简单POST:

Simple POST with 2 parameters:

field1=foo, 
field2=bar

我想拦截请求,将 field2 的值修改为bañ(注意ñ,在我的情况下无效,这就是我要测试的内容) 。

I would like to intercept the request, modify the value of field2 to be something like bañ (note the ñ, in my case is invalid and that is what I want to test).

推荐答案

好的,发布我把它拼凑在一起从以下youtube拼凑而来的答案视频:

Ok, posting the answer that I put together from piecing it together from the following youtube video:

使用Fiddler篡改客户端请求和服务器响应


  1. 启动fiddler(我正在使用Fiddler 4)

  1. Start fiddler (I'm using Fiddler 4)

您会注意到它拦截了所有浏览器和其他应用程序的所有流量

You will notice that it intercepts all traffic through all browsers and other applications

设置过滤器 - 这将使您只能查看您感兴趣的数据

Set a filter - this will enable you to view only the data you are interested in


  1. 在右侧,单击过滤器选项卡

  2. 选中'使用过滤器'

  3. 在主机上,使用'仅显示以下主机'

  4. 在文本框中在下面,把你正在测试的主机。在我们的测试环境中,请输入以下内容:testing.internalsite.com;

  5. 在断点一节中,选中断开POST请求

  1. On the right hand side, click on the filters tab
  2. Check 'Use Filters'
  3. On Hosts, use 'Show only the following Hosts'
  4. In the text box below that, put the host you are testing for. In our case for the test environment, put the following: testing.internalsite.com;
  5. In the section called 'Breakpoints', check 'Break request on POST'


  • 拦截请求

  • Intercept the request


    1. 在浏览器中,浏览到您正在测试的页面。在我们的案例中,我们将在欢迎页面上对服务器端验证进行测试: https:// testing .internalsite.com / yourapp / welcome.do

    2. 通过点击工具功能区中的X并选择全部删除来清除所有现有的已记录请求。

    3. 在浏览器中,将数据放入您感兴趣的表格中并点击提交。这是有效数据(通过客户端验证),您将使用fiddler进行更改。

    4. 在Fiddler中,您将看到带有红色图标的请求。单击请求以在右侧加载详细信息。

    5. 在Inspectors选项卡上,接着是WebForms选项卡,您可以修改提交的表单的参数。根据测试情况更改数据。

    6. 点击运行至完成按钮

    1. In your browser, navigate to the page which you are testing. In our case, it is the welcome page where we will be doing our testing of the server-side validation: https://testing.internalsite.com/yourapp/welcome.do
    2. Clear all the existing logged requests by hitting the 'X' in the tool ribbon and choosing 'Remove all'.
    3. In your browser, put the data into the form you are interested in testing and hit submit. This is valid data (passes client side validation) which you will be changing with fiddler.
    4. In Fiddler, you will see the request with the red icon. Click on the request to load the details on the right side.
    5. On the Inspectors tab, followed by the WebForms tab, you can modify the parameters of the form which was submitted. Change the data as appropriate for the test.
    6. Hit the 'Run to completion' button


  • 验证您的回答是否正确 - 如果您正在测试服务器端验证,通常会出现某种错误消息

  • Validate that your response is correct - usually some sort of error message if you are testing the server-side validations

    这篇关于如何在Fiddler中修改请求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆