美文网首页
fiddler script 把请求转发到另一个http接口

fiddler script 把请求转发到另一个http接口

作者: 写代码的杰西 | 来源:发表于2021-07-21 11:44 被阅读0次

    static function OnBeforeResponse(oSession: Session) {
       
        if (oSession.url.Contains('/xxxxxxxx')) {
              FiddlerApplication.Log.LogString("Request start");

    
           
            var _xhr = new ActiveXObject('Microsoft.XMLHTTP');
            var url =  'http://localhost:8666/list';
            _xhr.onreadystatechange = function() {}
            _xhr.open('POST', url, true);
            _xhr.setRequestHeader("Content-Type", "application/json; charset=utf-8");
            //_xhr.setRequestHeader( "Content-Type", "application/x-www-form-urlencoded;charset=utf-8");
            _xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
            _xhr.send( oSession.GetResponseBodyAsString());
            
            
        
        }
        

        if (m_Hide304s && oSession.responseCode == 304) {
            oSession["ui-hide"] = "true";
        }
    }

相关文章

网友评论

      本文标题:fiddler script 把请求转发到另一个http接口

      本文链接:https://www.haomeiwen.com/subject/mzcjmltx.html