Parameter passing to webapp on doGet(e)

2019-07-19 08:07发布

I'm trying to figure out how parameters in URL are passed to doGet() function. I tried to do

https://script.google.com/a/macros/[my domain].com/s/[some random string generated by GAS] followed by "&variable=data"

but it only gave me this error: "Sorry, the file you have requested does not exist."

FYI, https://script.google.com/a/macros/[my domain].com/s/[some random string generated by GAS] works well without "&variable=data".

1条回答
走好不送
2楼-- · 2019-07-19 08:49

To add GET parameters to the end of a URL, you need to use a ?.

So your URL should look something like this

http://script.[.......]/exec?variable=data&otherVariable=otherData

Also, be sure you publish your app to get this functionality. File > Manage Versions. Publish > Publish as Web App...

查看更多
登录 后发表回答