Skip to content

Commit bb669f0

Browse files
authored
Add example usage for RestGetWithBackoff
Added a background script example for using RestGetWithBackoff.
1 parent 00e790f commit bb669f0

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Background Script usage example for RestGetWithBackoff
2+
(function() {
3+
var helper = new RestGetWithBackoff();
4+
var data = helper.getAll({
5+
endpoint: 'https://api.example.com/v1/things?limit=100',
6+
headers: { 'Authorization': 'Bearer ${token}' },
7+
maxRetries: 4,
8+
baseDelayMs: 750
9+
});
10+
gs.info('Fetched ' + data.length + ' items total');
11+
})();

0 commit comments

Comments
 (0)