1、希望输出全为字典的格式:
{
"get": {
"method": "post",
"url": "https://qyapi.weixin.qq.com/cgi-bin/tag/get",
"params": {
"access_token": "${token}",
"tagid": 3
},
"json": null
}
}
则应该在yaml文件中写成:
get:
method: post
url: https://qyapi.weixin.qq.com/cgi-bin/tag/get
params:
access_token: ${token}
tagid: 3
json:
2、若希望tagid为一个列表,如下:
{
"tagid": [
{
"name": "${id}",
"class": "${class}"
}
]
}
则yaml文件的写法:
tagid:
- name: ${id}
class: ${class}
其中的${class}说明此处是一个变量的占位符
3、若希望tagid中的3为字符串:
"tagid": "3"
则可以yaml文件写成:
tagid: "3"