zoukankan      html  css  js  c++  java
  • fiddler 保存请求数据并发送到自己的服务器接口

    通过Rules菜单打开 Customize Rules 

    搜索 OnBeforeResponse 方法,再方法后面添加如下代码:

        if (oSession.fullUrl.Contains("https://mp.weixin.qq.com/mp/")){
                //通过ajax发送到服务端
                var xhr = new ActiveXObject('Microsoft.XMLHTTP');
                var url = 'http://domain.com/notify_url';
                //发送的数据
                var data = '{"response":"'+ oSession.GetResponseBodyAsString() +'","url":"'+ oSession.url +'","headers":"'+ oSession.oRequest.headers +'","raw":"'+ oSession.GetRequestBodyAsString() +'"}';
       
                //不需要返回值所以写啦个空回调
                xhr.onreadystatechange = function() {}
                xhr.open('POST', url, true);
                xhr.setRequestHeader("Content-Type", "application/json");
                xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
                xhr.send(data);
            }        
  • 相关阅读:
    1265 四点共面
    1298 圆与三角形
    1264 线段相交
    1185 威佐夫游戏 V2
    1183 编辑距离
    1089 最长回文子串
    HTML5 boilerplate 笔记(转)
    Grunt上手指南(转)
    RequireJS 2.0初探
    RequireJS学习笔记
  • 原文地址:https://www.cnblogs.com/rubekid/p/11870149.html
Copyright © 2011-2022 走看看