下载链接:http://repo1.maven.org/maven2/com/github/dreamhead/moco-runner/0.11.0/----moco-runner-0.11.0-standalone.jar 启动命令:java -jar ./moco-runner-0.11.0-standalone.jar http -p 8888 -c startup1.json 请求链接:http://192.168.0.103:8888/demo 解决浏览器打开乱码问题--response中加: "headers":{ "Content-Type":"text/html;charset=jbk" } 解决jmeter中乱码,在BeanShell PostProcessor中加: "Content-Type":"text/html;charset=jbk" 格式: [ { "description":"这是包括全部的get请求", "request":{ "uri":"/getAllDemo", "method":"get", "cookies":{ "login":"true" }, "headers":{ "content-type":"application/json" }, "queries":{ "name":"zuohuajian", "age":"25" } }, "response":{ "json":{ "zuohuajian":"success", "enabled":"1" }, "headers":{ "Content-Type":"text/html;charset=jbk" } } },{ "description":"这是包括全部的post请求", "request":{ "uri":"/postAllDemo", "method":"post", "cookies":{ "login":"true" }, "headers":{ "content-type":"application/json" }, "json":{ "name":"jinzhu", "age":"24" } }, "response":{ "json":{ "jinzhu":"success", "enabled":"2" }, "headers":{ "Content-Type":"text/html;charset=jbk" } } } ] 重定向: [ { "description":"重定向到百度", "request":{ "uri":"/redirect" }, "redirectTo":"http://www.baidu.com" }, { "description":"这是重定向到的请求", "request":{ "uri":"/redirect/topath" }, "redirectTo":"/redirect/new" }, { "description":"这是被重定向到的请求", "request":{ "uri":"/redirect/new" }, "response":{ "text":"重定向成功啦", "headers":{ "Content-Type":"text/html;charset=jbk" } } } ]
moco框架
最新推荐文章于 2025-06-29 11:52:48 发布