rest client
插件下载
创建 http 文件
使用
.http
结尾的文件可以被rest-client
插件识别
注意:
- 以
###
分割接口 @uri
可以定义请求前缀,且不能加""
- 示例里的接口服务器地址在国外,测试时可能会发生错误,发生错误时多试几次即可 http://jsonplaceholder.typicode.com/
@uri=https://jsonplaceholder.typicode.com ### GET {{uri}}/posts/1 ### GET {{uri}}/posts ### POST {{uri}}/posts Content-Type: application/json;charset=UTF-8 { "title": "foo", "body": "bar", "userId": 1 } ### PUT {{uri}}/posts/1 Content-Type: application/json;charset=UTF-8 { "id": 1, "title": "foo", "body": "bar", "userId": 1 } ### PATCH {{uri}}/posts/1 Content-Type: application/json;charset=UTF-8 { "title": "foo", } ### DELETE {{uri}}/posts/1 ### form表单传值 POST {{uri}}/file Content-Type: application/x-www-form-urlencoded fileName=helloHono&fileSize=1024