I am having trouble when trying to upload an image to Azure storage account. The issue is with the config header to make the request properly to the server. I have test this with postman making myself the request and works like a charm, but when trying to do it from angular with $http.put it is giving me the error
400 (Authentication information is not given in the correct format. Check the value of Authorization header.)
This is my javascript function
uploadToAzure: function (urlToUpload, fileType, file) {
var formattedUrl = urlToUpload.split('"')[1];
var fecha = new Date();
var config = {
headers:{}}
config.headers = {
'x-ms-blob-type': 'Blockblob',
'x-ms-blob-content-type': fileType,
'x-ms-date': fecha,
'x-ms-version': '2017-04-17',
//'Host': 'necesito1.blob.core.windows.net',
'Authorization_Token': 'SharedKey <myAccount>:<MyPublicAccessKey>'
};
return $http.put(urlToUpload, file._file, config);
I have read these articles where I found how to config my header properly Doc1////Stackoverflow answer
I get this header from postman if it helps
Am I missing something here? Any help would be appreciated.