如何在Postman API中测试分页?

ghg1uchk  于 2022-11-07  发布在  Postman
关注(0)|答案(1)|浏览(609)

我有API和测试在 Postman 。我可以测试一个页面,但不知道如何测试其他页面。基本上,想做分页在 Postman 。
下面是我从Postman API得到的响应

{
    "patient_stats": [
        {
            "last_appointment_date": "2022-09-14T11:30:00.000+01:00",
            "last_exam_date": "2022-09-14T11:15:00.000+01:00",
            "last_scale_and_polish_date": "2022-09-14T11:30:00.000+01:00",
            "next_appointment_date": "2022-09-28T16:15:00.000+01:00",
            "next_exam_date": "2023-09-20T16:15:00.000+01:00",
            "next_scale_and_polish_date": "2023-09-20T16:30:00.000+01:00",
            "created_at": "2020-07-28T16:25:04.762+01:00",
            "updated_at": "2022-09-14T11:52:46.144+01:00",
            "total_paid": "157.5",
            "total_invoiced": "157.5",
            "last_cancelled_appointment_date": "2022-11-23T12:30:00.000+00:00"
        },

        {
            "last_appointment_date": "2006-11-02T12:30:00.000+00:00",
            "last_exam_date": null,
            "last_scale_and_polish_date": null,
            "next_appointment_date": null,
            "next_exam_date": null,
            "next_scale_and_polish_date": null,
            "created_at": "2020-07-31T01:10:10.733+01:00",
            "updated_at": "2020-07-31T01:46:42.329+01:00",
            "total_paid": "0.0",
            "total_invoiced": "0.0",
            "last_cancelled_appointment_date": null
        }
    ],
    "meta": {
        "total": 13616,
        "current_page": 1,
        "total_pages": 545
    }
}

它显示总共545页。不知道如何循环第二页在 Postman 。
我尝试在参数中给予current_page = 2,但它没有显示第二页

有人能告诉我如何在Postman中测试吗?

aor9mmx1

aor9mmx11#

每个API都是不同的,命名根据它的开发方式而改变。例如,你可以尝试只使用“page”而不是“current_page”。我通常使用“page”。

?page=2

相关问题