Fiddler修改响应数据


简书:https://www.jianshu.com/p/194a61e2fcca

CSDN:https://blog.csdn.net/lovedingd/article/details/78354343

1. 方法一:Automatic Breakpoints功能

  缺点:所有响应都会拦截

2. 方法二:命令--fiddler左下角黑框中输入命令

  XXX可以是url的全部,也可以是部分

  请求打断点:bpu XXX   取消断点:bpu+Enter

  响应打断点:bpafter XXX  取消断点:bpafter+Enter

3. 方法三:AutoResponder

4. 方法四:脚本(JScript.NET语言

  Rules --- Customize Rules打开脚本文件

static function OnBeforeResponse(oSession: Session) {
        if (m_Hide304s && oSession.responseCode == 304) {
            oSession["ui-hide"] = "true";
        }
		
		// 以下是新加的
		if(oSession.host == "www.baidu.com"){
			if(oSession.fullUrl.Contains("www.baidu.com")){
				var responseStringOriginal = oSession.GetResponseBodyAsString();
				//var responseJSON = Fiddler.WebFormats.JSON.JsonDecode(responseStringOriginal);
								
				//responseJSON.JSONObject['data'] = "hahaha";
				responseStringOriginal = "hahaha";
				//var responseStringDestinal = Fiddler.WebFormats.JSON.JsonEncode(responseJSON.JSONObject)
				oSession.utilSetResponseBody(responseStringOriginal)
			
			}
		}
	}

  

  


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM