我想在此处的请求是特殊功能之前更改参数的名称,但没有任何效果
static function ReplaceQueryParameter(sName: String, sValue: String)
{
var re:RegExp;
if (sValue == null) {
re = new RegExp( "(" + sName + "=)(([^&]*)|$)");
var ret = gs_QueryString.replace(re, '');
gs_QueryString = ret;
}
else {
re = new RegExp( "(" + sName + "=)(([^&]*)|$)");
var ret = gs_QueryString.replace(re, "$1" + sValue);
gs_QueryString = ret;
}
}
static function OnBeforeRequest(oSession: Session)
{
gs_QueryString = System.Text.Encoding.UTF8.GetString(oSession.requestBodyBytes);
ReplaceQueryParameter('username','username1');
SetBodyFromQueryString(oSession);
}
有什么帮助吗?