【问题标题】:How to test pagination in Postman API?如何在 Postman API 中测试分页?
【发布时间】:2022-09-30 18:52:02
【问题描述】:

我在 Postman 中进行 API 和测试。我可以测试一个页面,但不确定如何测试其他页面。基本上,想在 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 中进行测试?

    标签: api postman


    【解决方案1】:

    每个 API 都不同,命名取决于它的开发方式。例如,您可以尝试只使用“page”而不是“current_page”。我通常将其用作“页面”。

    ?page=2
    

    【讨论】:

      猜你喜欢
      • 2017-08-15
      • 2022-01-08
      • 2020-05-27
      • 1970-01-01
      • 2019-12-18
      • 2020-04-27
      • 1970-01-01
      • 2020-12-31
      • 1970-01-01
      相关资源
      最近更新 更多