joltup / rn-fetch-blob

A project committed to making file access and data transfer easier, efficient for React Native developers.
MIT License
2.81k stars 772 forks source link

There is no way to change fetch().blob() info object, always undefined #673

Open idanlo opened 3 years ago

idanlo commented 3 years ago

When calling await (await fetch(....)).blob() there is an error

TypeError: undefined is not an object (evaluating 'info.headers['Content-Type']')

looking at the code (index.js) on the FetchBlobResponse class, that holds the blob() method, there is no way to set the info object, it is received in the constructor, but that class is initiated in the fetch function of RNFetchBlob and there is no way to pass the options, meaning that the blob() function will always fail

idanlo commented 3 years ago

Also the typescript types for this function are incorrect, it states that this function requires 2 arguments (contentType and sliceNumber) but it does not get any parameters in the index.js file