如何验证api的respose值?

时间:2018-12-13 11:16:37

标签: web-api-testing

我有很多要测试的api,大多数thoes api的响应格式如下:

{
"time": 1544698929,
"errno": 0,
"error": "",
"data": [
    {
        "ma_no": "1108",
        "ma_name": "138",
        "ma_code": "10000138",
        "city_no": "",
        "create_date": "",
        "stop_time": "0"
    },
    {
        "ma_no": "1109",
        "ma_name": "139",
        "ma_code": "10000139",
        "city_no": "",
        "create_date": "",
        "stop_time": "10"
    }
]

}

我现在验证thoes api的方法是将db的查询结果结合为api的格式,但是我认为它不是那么优雅,我相信还有一些更好的我不知道要验证api,请帮忙!

0 个答案:

没有答案