dropbox / dropbox/dropbox-sdk-js

feat(`filesSaveUrl`): add possibility to add extra headers on request

Open
#720 3 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
970
Forks
353
Avg merge
9h 3m
Merged PRs (30d)
2

Description

## Why is this feature valuable to you? Does it solve a problem you're having?

I want to be able to save a file in Dropbox (using the `filesSaveUrl` function) that's only accessible when adding extra `headers` to the request.

## Describe the solution you'd like

Having an (optional) `requestHeaders` argument that can be passed to the `filesSaveUrl` method and is used when the job is run.

```js
const dropbox = new Dropbox({ accessToken: process.env.DROPBOX_TOKEN });

dropbox.filesSaveUrl({ requestHeaders, path, url });
```

## Describe alternatives you've considered

Downloading the blob myself and uploading it again with the `filesUpload` method

```js
axios
.get(url, { headers, responseType: 'arraybuffer' })
.then({ data }) => {
const dropbox = new Dropbox({ accessToken: process.env.DROPBOX_TOKEN });

dropbox.filesSaveUrl({ contents: data, path });
});
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.