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