Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- request(initialRequest, function (error, response, body) {
- if (error) throw error;
- while (body.pagination.cursor) {
- let subsequentRequest = {
- url: `http://myurl.com&pagination=${body.pagination.cursor}`,
- method: "GET",
- json: true
- };
- request(subsequentRequest, function (error, response, body) {
- if (error) throw error;
- console.log("Still more");
- });
- }
- res.json(body);
- });
Add Comment
Please, Sign In to add comment