moco框架—get请求

本文模拟了get 带参数和不带参数的两种方式。

http://127.0.0.1:8888/getdemo  (不带参数访问路径)

http://127.0.0.1:8888/getwithparam?name=zhangshan&age=18(带参数的get请求访问方式)

 1 [
 2   {
 3     "description": "模拟一个没有参数的get请求",
 4     "request": {
 5       "uri": "/getdemo",
 6       "method": "get"
 7     },
 8     "response": {
 9       "headers": {
10         "Content-Type": "text/html;charset=gbk"
11       },
12       "text": "这是一个没有参数的get请求"
13     }
14   },
15   {
16     "description": "这是一个带参数的get请求",
17     "request": {
18       "uri": "/getwithparam",
19       "method": "get",
20       "queries": {
21         "name": "zhangshan",
22         "age": "18"
23       }
24     },
25     "response": {
26       "headers": {
27         "Content-Type": "text/html;charset=gbk"
28       },
29       "text": "我是张山"
30     }
31   }
32 ]

猜你喜欢

转载自www.cnblogs.com/linxinmeng/p/12604323.html