接口加延迟
//最顶部引入
import System.Threading;
//OnBeforeResponse加入下面代码
if(oSession.uriContains("XXXX")){
Thread.Sleep(3000);
}
请求头参数增删改
//放在OnBeforeRequest中
//删除
oSession.oRequest.headers.Remove("If-None-Match");
//增加或修改
oSession.oRequest["Pragma"] = "no-cache";
修改接口返回状态码(拦截接口返回信息)
//放在OnBeforeResponse里面
if( oSession.uriContains("XXXXXX")){
var oBody = "<html><body>[Fiddler] Authentication Required.<BR>".PadRight(512, ' ') + "</body></html>";
oSession.utilSetResponseBody(oBody);
// Build up the headers
oSession.oResponse.headers.HTTPResponseCode = 401;
}
get请求快速修改请求参数
if (oSession.fullUrl.Contains("1111")) {
oSession.fullUrl=oSession.fullUrl.Replace("1111",'2222')
}