From 6b856fdf740bf353f5be27c69ee4ee24f9e887e6 Mon Sep 17 00:00:00 2001 From: alibw <69758323+alibw@users.noreply.github.com> Date: Sun, 3 Sep 2023 16:51:54 +0330 Subject: [PATCH] Added : prefer header test --- Pagination.http | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Pagination.http b/Pagination.http index 7d81cd0..49b52ec 100644 --- a/Pagination.http +++ b/Pagination.http @@ -16,4 +16,16 @@ GET {{baseUrl}}/products?limit=40&offset=7 test('OK content-range', () => { equal(response.headers['content-range'], '7-46/*'); }); -}} \ No newline at end of file +}} + +GET {{baseUrl}}/products?limit=20&offset=40 +Prefer: count=exact +?? status == 206 +{{ + const { equal } = require('assert'); + let responseItems = JSON. parse(response.body); + let itemsCount = responseItems.length; + test('OK content-range', () => { + equal(response.headers['content-range'], '40-59/77'); + }); +}}