Trying to download file from backed (React Native) I need to do POST request with header (token) File don't download.
const response = await RNFetchBlob.config({
fileCache: true,
appendExt: 'pdf',
path: fs.dirs.DownloadDir + '/file.pdf',
addAndroidDownloads: {
useDownloadManager: true,
notification: true,
path: fs.dirs.DownloadDir + '/file.pdf',
description: 'File downloaded by download manager.',
},
}).fetch(
'POST',
`${url}`,
{
'access-token': token,
'Content-Type': 'application/pdf',
'content-disposition': 'attachment; filename="document.pdf',
},
bodyString,
)