I'm getting a
Script function not found: doGet
OR
Script function not found: doPost
when I GET/POST to my Google script:
function doGet(e){return ContentService.createTextOutput("User says")}
function doPost(e) {
return HtmlService.createHtmlOutput(
"<form action='http://www.example.com/users/gmail_permission/' method='post' id='foo'>" +
"<input type='hidden' name='gmail' value='getEmail()' >" +
"<input type='hidden' name='id' value='e.parameter.user_id' >" +
"</form>" +
"<script>document.getElementById('foo').submit();</script>");
}
function getEmail() {
return Session.getActiveUser().getEmail();
}
The weird thing is I'll get the above error when I visit the Webapp URL on my browser. But when I use Hurl.it, I just get redirected to Google Drive. But when I 'Test web app for your latest code.' on google.script.com, the GET response works fine.
Pretty lost as to what is going on.... here is my script:
https://script.google.com/macros/s/AKfycbz0XGeoEuP4V6W60N7yP-dDiLltPefxmqzhMJurnGzOhPfqA_er/exec
Here are the GETs
FROM Hurl.it - GET https://accounts.google.com/ServiceLogin?service=wise&followup=https://script.google.com/macros/s/AKfycbz0XGeoEuP4V6W60N7yP-dDiLltPefxmqzhMJurnGzOhPfqA_er/exec&continue=https://script.google.com/macros/s/AKfycbz0XGeoEuP4V6W60N7yP-dDiLltPefxmqzhMJurnGzOhPfqA_er/exec&passive=1209600
FROM script.google.com: https://script.google.com/macros/s/AKfycbyCH4Jk7VcEIhE52jIorIBzcghRYAPRuwuzFSHwaWIB/dev
FROM browser:https://script.google.com/macros/s/AKfycbz0XGeoEuP4V6W60N7yP-dDiLltPefxmqzhMJurnGzOhPfqA_er/exec
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…