UrlFetchApp With Login Credentials

July 31, 2019
Login information disallowed
var username = ...
var password = ...
var url = ...

var options = {
    headers: {
        "Authorization": "Basic " + Utilities.base64Encode(username + ":" + password)
    }
};

var response = UrlFetchApp.fetch(url, options);
Logger.log(response.getContentText());

The following fail with Login information disallowed.

UrlFetchApp.fetch('https://USERNAME:PASSWORD@www.mywebsite.com/do_something')
This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.