背景:用postman做接口测试可以使用application/x-www-form-urlencoded请求,也可以使用json请求,接口文档如下:
请求参数
字段 |
类型 |
是否必填 |
注释 |
website |
String |
Y |
选择网站: =GB |
activity_child_id |
Int |
N |
Id |
update_product_cycle |
int |
N |
产品id |
website_online_time |
array |
N |
网站上架天数: [start开始,end结束] 网站上架天数不以当前时间计算,按数据更新日期算 |
now_price |
array |
N |
当前售价:[开始(float),结束(float)] |
rule_one |
object |
Y |
规则一:必填 type:sku_sales(近1/7/15/30天销量),sku_increase_rate (近1/7天销量环比增长率), sku_sale_amount(近1/7/15/30天销售额) day:1/7/15/30 top_num:top前多少sku { "type":"sku_sales", "day":1, "top_num":10 } |
postman中使用from请求array请求格式如下:
website_online_time[start] 、website_online_time[end] 两种格式,object格式也是如此
而在json中数组的请求为以下内容
"website_online_time": [
"10",
"20"
],
object类型为大括号请求