Skip to content

Instantly share code, notes, and snippets.

@jjhesk
Created January 14, 2016 08:03
Show Gist options
  • Save jjhesk/031628408f10c94697d5 to your computer and use it in GitHub Desktop.
Save jjhesk/031628408f10c94697d5 to your computer and use it in GitHub Desktop.
this google app script is to build the redirection pie Uri
function httpredirectpie(url) {
var options = {
headers:{
"Accept":"application/json",
"X-Api-version":"2.0"
},
muteHttpExceptions: true,
followRedirects: false
};
var responose = UrlFetchApp.fetch(url, options);
var stored = responose.getHeaders();
Logger.log(stored.toSource());
return stored['Location'];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment