在doGet(e)上传递给webapp的参数 [英] Parameter passing to webapp on doGet(e)
问题描述
我试图弄清楚URL中的参数是如何传递给 doGet()
函数的。
我试过做
$ b $ https://script.google.com/a/macros/ [我的域名] .com / s / [由GAS生成的一些随机字符串]
后跟& variable = data
但它只给了我这个错误:
对不起,您请求的文件不存在。
FYI, https://script.google.com/a/macros/ [我的域名] .com / s / [由GAS生成的一些随机字符串]
& variable = data。
到URL的末尾,您需要使用?
。
因此,您的网址应该看起来像这样
http:// script。[.......] / exec?variable = data& otherVariable = otherData
另外,请确保您发布您的应用程序以获得此功能。文件>管理版本。发布>发布为Web应用程序...
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".
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...
这篇关于在doGet(e)上传递给webapp的参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!