Moco配置
一、下载
moco下载地址
http://repo1.maven.org/maven2/com/github/dreamhead/moco-runner/
二、启动
前提:①、配置好Java环境 ②、下载moco-runner-0.10.0-standalone.jar
启动命令:java -jar moco-runner-0.10.0-standalone.jar http/start -p 2256 -c demo.json
启动成功后,在浏览器输入 http://localhost:2256 or http://127.0.0.1:2256即可访问
参数说明:
p: (port)端口号
c:(config)配置文件
其他:
1、命令执行目录必须在moco的jar所在路径
2、config文件和jar放在同一目录下
3、返回中文乱码的解决方式:在启动moco-runner的时候,设置字符编码方式为utf-8
java -Dfile.encoding=utf-8 -jar moco-runner-0.10.0-standalone.jar start -p 4416 -c demo_post_others.json
三、配置文件
1、get请求
1)不带参数的get请求