I'm trying to add a JWT for authorisation purposes but it's being ignored on Android, can't test this on IOS. Code is as follows, I'm also attaching the output of an echo server
apiUpload(){
if (!this.filePath) {
Nat.toast('Please pick a file first :)')
return
}
Nat.upload(this.url, {
path: this.filePath,
method: 'POST',
formData: {
framework: 'natjs',
},
headers: {
'x-sign': 'customheader',
'x-header': 'customheader',
'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.SomeTokenValue',
}
}, {
onProgress: (p) => {
Nat.toast('Progressing: ' + p)
}
}, (err, res) => {
if (err) {
Nat.toast('[ERROR] ' + JSON.stringify(err))
return
}
Nat.toast(JSON.stringify(res))
})
}
With something like this, the file is posted, the formData is posted but headers are not adding the custom ones, jut just add a series of apparently default headers such as User-Agent etc but not the custom ones in my code sample. See the output of a debug server: