I've been struggling to upload a file using ExtJS and web API. The issue I'm facing is that when trying to send an authorization header to the server, it always returns as null. I even attempted to include the header in the XHR request within the beforerequest
function, but still had no luck.
Below is the code snippet:
Ext.Ajax.request({
url: 'url',
method: 'Post',
headers : {'Authorization':'Bearer '+access_token},
form: form,
isUpload: true,
params: {id: id},
After some research, I found out that sending a header in form submit might not be possible. Are there any alternative methods I can explore to achieve my goal?