【问题标题】:fiddler script send http request提琴手脚本发送http请求
【发布时间】:2017-03-15 13:39:50
【问题描述】:

我需要在 onBeforeResponse 方法中发送 http 请求。
我正在尝试在 CustomRules.js 中添加此方法

static function httpGet(theUrl){
    var xmlHttp = new XMLHttpRequest();
		xmlHttp.open( "GET", theUrl, false );
		xmlHttp.send( null );
		return xmlHttp.responseText;
	}

但我有一个错误"XMLHttpRequest" is not defined
有什么方法可以从提琴手脚本规则发送http请求?

【问题讨论】:

    标签: javascript xmlhttprequest fiddler


    【解决方案1】:

    Fiddler 没有浏览器对象模型,因此没有定义 XMLHttpRequest。幸运的是,它提供了许多不同的方式来发送 HTTP 请求。例如:

    var oSD = new System.Collections.Specialized.StringDictionary();
    var newSession = FiddlerApplication.oProxy.SendRequestAndWait(oSession.oRequest.headers, oSession.requestBodyBytes, oSD, null);
    if (200 == newSession.responseCode)
    {
     //....
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-07-13
      相关资源
      最近更新 更多