旅游网站开发指导,上海网站备案多久,wordpress分享功能,沈阳专业制作网站公司哪家好首先在Chapter7文件夹下再新建一个startGet.json startget.json代码如下#xff0c;因为是get请求#xff0c;所以要写method关键字#xff0c;有两个#xff0c;一个是有参数#xff0c;一个是无参数的请求。 [{description:模拟一个没有参数的get请求…首先在Chapter7文件夹下再新建一个startGet.json startget.json代码如下因为是get请求所以要写method关键字有两个一个是有参数一个是无参数的请求。 [{description:模拟一个没有参数的get请求,request:{uri:/getDemo,method:get},response:{text:这是一个没有参数的get请求}},{description:模拟一个带参数的get请求,request:{uri:/getwithparam,method:get,queries:{name:huhanshan,age:18}},response:{text:这是一个带参数的get请求,胡汉山又回来了}}
] 启动mock服务器 java -jar ./moco-runner-0.12.0-standalone.jar http -p 8888 -c startupGet.json 然后在浏览器访问localhost:8888/getDemo 这是一个不带参数的请求 log 然后也可以访问http://localhost:8888/getwithparam?namehuhanshanage18 这是一个带参数的请求吧 log 转载于:https://www.cnblogs.com/peiminer/p/9636356.html