Skip to content

Instantly share code, notes, and snippets.

@bgraw3
Forked from etjossem/ImportJSONBasicAuth.js
Created November 20, 2015 23:22
Show Gist options
  • Save bgraw3/cc3baf267e271d7e75a5 to your computer and use it in GitHub Desktop.
Save bgraw3/cc3baf267e271d7e75a5 to your computer and use it in GitHub Desktop.
Modification to ImportJSON
function ImportJSONBasicAuthentication(url, query, parseOptions, username, password) {
var fetchOptions = {
"headers" : {
"Authorization" : 'Basic ' + Utilities.base64Encode(username + ':' + password)
},
muteHttpExceptions: true
};
return ImportJSONAdvanced(url, fetchOptions, query, parseOptions, includeXPath_, defaultTransform_);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment