How do I add headers onto a download request?
Using react native 0.26 and react-native-fs 1.4 I need to pass authentication headers / tokens to a download request for files, I can't see how I would do that by calling:
downloadFile(fromUrl, toFile, begin, progress) {.. etc
My context is I'm using this to grab a PDF for display in Android via https://github.com/cnjon/react-native-pdf-view
Can someone advise?
Many thanks, Vince
@vince-rowe At the moment, you can't I'm afraid. I intend to make the signature for downloadFile more like uploadFile so that it can have more optional parameters (such as headers). We can support the old parameters by inspecting the argument length. Will be a few days before I get a moment to implement this though.
@vince-rowe The method downloadFile now supports setting custom HTTP headers. Please see updated readme.