基本使用

定义变量

多个请求用###分割

  1. @testAPIhost = http://coc-api-admin.gishad.com/v1
  2. @contentType = application/json
  3. # 代理商系统
  4. ### 代理商详情
  5. GET {{testAPIhost}}/agents/:id HTTP/1.1
  6. content-type: {{contentType}}
  7. ### 代理商类型列表
  8. GET {{testAPIhost}}/agent_types HTTP/1.1
  9. content-type: {{contentType}}
  10. ### 代理商列表
  11. GET {{testAPIhost}}/agents HTTP/1.1
  12. content-type: {{contentType}}

POST请求

content-type与请求的内容需要间隔一行

POST http://dummy.restapiexample.com/api/v1/create HTTP/1.1
content-type: application/json

{
    "name":"Hendry",
    "salary":"61888",
    "age":"26"
}

生成请求代码

ctrl+shift+p
选择这个Generate
image.png

可以生成各种语言的请求代码
image.png

右键也可以选择生成
image.png

参考
https://zhuanlan.zhihu.com/p/54266685
https://www.jianshu.com/p/7bbf4af2df99