1

I'm trying to remove the file from the API using React-Native-Fetch-Blob, but it doesn't work. However when trying to delete the file using Postman it works.

var dataToServer = { 'path' : this.state.path};

RNFetchBlob.fetch('DELETE', 'url', {
        'Authorization' : tokenJSON.access,
        'Content-Type' : 'application/json',
      }, JSON.stringify(dataToServer))
      .uploadProgress((written, total) => {
        console.log('uploaded', written / total)
      })
Victor Castillo Torres
  • 10,581
  • 7
  • 40
  • 50
user3440030
  • 45
  • 1
  • 8

1 Answers1

0

Try with "regular" fetch from Fetch API

fetch(url, {
    method: 'DELETE',
    headers: {
        'Authorization': tokenJSON.access,
        'Content-Type': 'application/json',
    },
}).then(response =>

);
zarcode
  • 2,465
  • 17
  • 31