I have this string in a Google Apps Script
const response = UrlFetchApp.fetch(url, { 'method': 'POST', 'headers': {'Authorization': 'Basic QWRtaW5pc3RyYXRv','Content-Type': 'application/json'}}); I can't find a working way to have the string "QWRtaW5pc3RyYXRv" read from a variable.
Something like var key = "QWRtaW5pc3RyYXRv"; const response = UrlFetchApp.fetch(url, { 'method': 'POST', 'headers': {'Authorization': 'Basic + key +','Content-Type': 'application/json'}});
Does not work!!