Reputation: 1625
I feel like I'm totally missing something about how to get back the results from a function call to a doGet() Google appscript. Please can anyone suggest what I'm doing wrong.
Using a HTTP GET request all I get back is the entire html content from the app and the doGet() hasn't executed.
my doGet() looks like this.
function doGet(e) {
var params = JSON.stringify(e);
return HtmlService.createHtmlOutput(params);
}
The returned data looks like this.
Upvotes: 1
Views: 2081
Reputation: 5892
I think you are looking for ContentService
rather than HtmlService
Something along the lines of this:
function doPost(e) {
return ContentService.createTextOutput(JSON.stringify(e))
}
HtmlService will output a HTML page
Authorization Also, make sure you have "anyone even anonymous" can run the web app option selected under "Publish>Deploy>Web app" Window.
Upvotes: 4