I am using Google Apps Script to make a series of HTTP Requests. The endpoint I have been using just switched to cursor-based pagination.
The response looks like this.
{...
Link=
<https://x.shopify.com/admin/api/2019-10/inventory_levels.json?limit=250&page_info=abc>;rel="previous",
<https://x.shopify.com/admin/api/2019-10/inventory_levels.json?limit=250&page_info=def>;rel="next"
}
I can use response['Link']
to get it down to
<https://x.shopify.com/admin/api/2019-10/inventory_levels.json?limit=250&page_info=abc>;rel="previous",
<https://x.shopify.com/admin/api/2019-10/inventory_levels.json?limit=250&page_info=def>;rel="next"
Is there a way to extract page_info
reliably from the "next"
URL without regular expression? I am fine resorting to regular expression but I wondered if there was specific method for getting it.
Thanks in advance for your help. I dabble and get that I still have a ton to learn.