I'm writing a script in Airtable Extensions to pull data from Canvas API. I've set the per_page limit to 100, because that's the maximum number of objects Airtable will retrieve at once for an external API.
I need to use pagination to download the rest of the results. According the Canvas API reference, it's in the response header Link value. I'm able to see this in Postman but how do I retrieve this in an Airtable script?
How do I set up a loop to paginate until the end? All the online discussions are about Airtable's API and I can't find how to retrieve response headers.
let currentCourses = await remoteFetchAsync("https://XXXX?per_page=100", requestOptions);
const currentCoursesData = await currentCourses.json();
console.log(currentCoursesData);