microsoft/vscode-file-downloader-api

Add HTTP headers

Closed this issue · 1 comments

Is there a way to add an authorization token via HTTP headers when downloading a file?

You can add an authorisation token to the settings property which is of type FileDownloadSettings.

For instance in the downladFile method you could pass in something like

settings = { headers: { Authorization: `Bearer xxxxxxxx` } } as FileDownloadSettings

I'm closing this as it's a year old - please feel free to re-open should you need some more help