react-native-background-upload icon indicating copy to clipboard operation
react-native-background-upload copied to clipboard

Can't set Authorization header

Open SteveTro opened this issue 3 years ago • 1 comments

i try to upload files to the google storage json api. I get the token from a cloud function but when i try to upload the images like this:

this.options = {
        customUploadId: _uploadID,
        url: url,
        path: path,
        method: 'POST',
        type: 'raw',

        header: {
          "Authorization": `Bearer ${token}`,
          'content-type': 'application/octet-stream',
        },
};

i always get an error 401 "Anonymous caller does not have storage.objects.create access to the Google Cloud Storage object." If i try the request in postman everything works fine.

How are the headers added?

SteveTro avatar Oct 29 '20 14:10 SteveTro

@SteveTro it should be called "headers"

reime005 avatar Oct 30 '20 10:10 reime005