Hey everyone,
I am trying to paginate products on my shopify app. I followed this tutorial : https://shopify.dev/api/usage/pagination-rest#make-a-paginated-request-and-iterate-through-the-pages. The problem is when i request to the Shopify API, I don’t get the Link in the response header.
Here is my code :
let url = `https://${req.user.shop}/admin/api/2022-04/products.json?limit=${limit}`;
let options = {
method: 'GET',
mode: 'no-cors',
uri: url,
json: true,
headers: {
'X-Shopify-Access-Token': req.accessToken,
'content-type': 'application/json',
}
};
request(options)
.then(function (parsedBody){
console.log(res._headers);
console.log(parsedBody.products);
res.status(200).json(parsedBody.products);
}).catch(function (err) {
console.log(err);
res.json(err);
})
Thanks for help!