The following code is from plain old javascript, but it extracts the link from the headers.
function getNextLink(xhr){
var links = xhr.getResponseHeader("link");
var linksArr =links.split(',');
var nextlink = '';
var thislink = '';
for (var x=0; x<linksArr.length; x++){
thislink = linksArr[x];
if (thislink.indexOf('rel="next"')>-1){
nextlink = thislink.split('>')[0].substring(1);
//console.log(nextlink);
}
}
return nextlink;
}
I don't work in Postman much, but you're looking at a Test that looks for the Next link and if it exists, then call the same script again, so something like:
pm.test("Links header is present", function () {
pm.response.to.have.header("Links");
// do stuff with pm.response.headers.get("Links") I think.
});