I just create a doGet function in my web app,
function doPost(e){
var userName = e.parameter.userName;
return ContentService.createTextOutput(userName);
}
and I published it to the public, anyone could execute it the url is "https://script.google.com/a/slt.org.au/macros/s/AKfycby2pFGHc3qWaxnD4WGTLMEAPMUocohzH_-OsUPxwqi8kmWfRZs8/exec"
and I add "?userName=Leon" at the end
I type the url "https://script.google.com/a/slt.org.au/macros/s/AKfycby2pFGHc3qWaxnD4WGTLMEAPMUocohzH_-OsUPxwqi8kmWfRZs8/exec?userName=Leon" at the end, and I only want it to just return my username, but it returns so many things "{"parameter":{"userName":"Leon"},"contextPath":"","contentLength":-1,"queryString":"userName=Leon","parameters":{"userName":["Leon"]}}"
I tried both parameter and parameters, doPost(e) and doGet(e), all did not work.. Could someone to help me that why these cannot work?