We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
//如果是post请求,则需转成base64 if(runapi.getMethod() == 'post'){ var all_param = runapi.getAllParam();
//处理参数 var post_data={}; for(var i = 0; i < all_param.length; i++){ index = all_param[i]['name'] if(index!=''){ if(runapi.getParam(index) == "{{USERNAME}}"){ post_data[index] = runapi.getVar("USERNAME") }else{ post_data[index] = runapi.getParam(index) } //runapi.moveParam(index) 在这里执行方法去除掉不提交 } } //转成json字符串后再进行base64编码 var post_json = JSON.stringify(post_data); var base64_data = runapi.CryptoJS.enc.Utf8.parse(post_json ).toString(runapi.CryptoJS.enc.Base64); runapi.setParam("base64_data",base64_data )
}
The text was updated successfully, but these errors were encountered:
runapi.setParam("name","") // 根据name设置请求表单(放在Body里的)的一个参数 将值设置成空后,也是会有这个参数上传
Sorry, something went wrong.
我第一次听说这种会删除掉参数的需求。个人感觉是非常少数的需求。建议服务端忽略其他多余参数即可。或者接口一开始就应该设置为 post json的方式,而非表单的方式
这边通过runapi测试的时候,是这样传的,转成base64编码就通过执行前脚本来处理了,不过问题不大,到时候前端不传这些参数就好
No branches or pull requests
//如果是post请求,则需转成base64
if(runapi.getMethod() == 'post'){
var all_param = runapi.getAllParam();
}
The text was updated successfully, but these errors were encountered: