Skip to content

Commit

Permalink
does(README): tryHeaders
Browse files Browse the repository at this point in the history
  • Loading branch information
ido-pluto committed Jul 12, 2024
1 parent 626758c commit ba7fbf3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,14 @@ const downloader = await downloadFile({
url: 'https://example.com/file.large',
savePath: './this/path/file.large',
headers: {
'Authorization': 'Bearer token'
}
'Authorization': 'Bearer token 1'
},
// You can also add alternative headers in case of an 400-499 error
tryHeaders: [
{
Authorization: 'Bearer token 2'
}
]
});

await downloader.download();
Expand Down

0 comments on commit ba7fbf3

Please sign in to comment.