Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fiddler 高级用法 #10

Open
topcss opened this issue Jan 24, 2019 · 0 comments
Open

fiddler 高级用法 #10

topcss opened this issue Jan 24, 2019 · 0 comments

Comments

@topcss
Copy link
Owner

topcss commented Jan 24, 2019

通过“规则”,“自定义规则”打开规则脚本。修改它,实现修改请求和响应的功能。

参照:
https://www.52pojie.cn/thread-854434-1-1.html
https://blog.csdn.net/qq_21051503/article/details/50678030
https://blog.csdn.net/crisschan/article/details/45602745

另存为的例子
修改 OnBeforeResponse 方法

        if (oSession.fullUrl.Contains("https://entree.XXX.com/ddarticle/v1/article/get")){
            oSession["ui-color"] = "red";
            oSession.utilDecodeResponse();//消除保存的请求可能存在乱码的情况
            var fso;
            var file;
            fso = new ActiveXObject("Scripting.FileSystemObject");
            var strBody =  oSession.GetResponseBodyAsString();
            
            //文件保存路径,可自定义
            var path = "D:\\XXX\" + System.DateTime.Now.ToString("yyyyMMdd_HHmmss")+ ".json";
            //FiddlerObject.alert(path);
            file = fso.OpenTextFile(path, 8 ,true, true);

            file.writeLine(strBody);
            file.close();
        }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant