美文网首页
Moco之Get方法

Moco之Get方法

作者: Lutous | 来源:发表于2019-07-29 23:45 被阅读0次

Json文件为:

[
  {
    "description":"模拟一个没有参数get请求",
    "request":{
      "uri":"/getdemo",
      "method":"get"
    },
    "response":{
      "text":"这是一个没有参数的get请求"
    }

  },
  {
    "description":"这是一个带参数get请求",
    "request":{
      "uri":"/getwithparam",
      "method":"get",
      "queries":{
        "name":"huhansan",
        "sex":"20"
      }
    },
    "response":{
      "text":"我胡汉三又回来啦!!!!"
    }

  }

]

启动方式同Moco启动
浏览器中输入:

不带参数:http://localhost:8888/getdemo
带参数:http://localhost:8888/getwithparam?name=huhansan&age=18

相关文章

网友评论

      本文标题:Moco之Get方法

      本文链接:https://www.haomeiwen.com/subject/qeswrctx.html