static function OnBeforeResponse(oSession: Session) {
if (m_Hide304s && oSession.responseCode == 304) {
oSession["ui-hide"] = "true";
}
//下面是新加到
if (oSession.fullUrl.Contains("a.thief.im:8000/api/user/login")){
var responseStringOriginal = oSession.GetResponseBodyAsString();
var responseJSON = Fiddler.WebFormats.JSON.JsonDecode(responseStringOriginal);
if (0==responseJSON.JSONObject['code']) { //code=0表示接口正常的响应,根据实际情况删减
responseJSON.JSONObject['data']['is_vip'] = "1"; //替换xxx字段的值
var responseStringDestinal = Fiddler.WebFormats.JSON.JsonEncode(responseJSON.JSONObject);
oSession.utilSetResponseBody(responseStringDestinal);
}
}
}
fiddler自定义规则修改返回参数
于 2021-08-31 14:46:34 首次发布