moco-runner 构建mock测试服务器
下载 下载最新的JAR 这个下载有些慢,可以网盘获取: 链接: https://pan.baidu.com/s/1PzwGCcrWNwdn6R2Cpr11Xw 密码:t8rk 简单运行 java -jar moco-runner-0.12.0-standalone.jar http -p 9090 -c foo.json foo.json [ { "response": { "text": "foo" } } ] Post JSON 配置文件 [ { "request": { "text": "foo" }, "response": { "text": "bar" } }, { "request": { "uri": "/json", "text": { "json": "{\"foo\":\"bar\"}" } }, "response": { "text": "foo" } } ] 请求一: POST http://localhost:9090/json Accept: */* Cache-Control: no-cache {"foo":"bar"} 响应一: POST http://localhost:9090/json HTTP/1.1 200 OK Content-Length: 3 Content-Type: text/plain; charset=utf-8 foo