参数是空的,用于简单的DOGET应用程序脚本功能。为什么?
在 Google Apps 脚本中,我尝试显示发送到简单 doGet 函数的参数,如下所示:
function doGet(e) {
let response = e;
return ContentService
.createTextOutput(JSON.stringify(response))
.setMimeType(ContentService.MimeType.JSON);
}
我尝试放入参数以在 Postman 中查看它们,无论我做什么,输出都是空的。
[{
"contentLength": -1,
"parameter": {},
"parameters": {},
"queryString": "",
"contextPath": ""
}][1]
我的目标是:如何让任何内容显示在参数对象中?
在 Postman 中,我手动添加参数,并在谷歌浏览器中复制了相同的参数。但它仍然是一个被返回的空对象。
我缺少什么?
Within Google Apps Scripts, I'm attempting to display the parameters being sent to my simple doGet function shown below:
function doGet(e) {
let response = e;
return ContentService
.createTextOutput(JSON.stringify(response))
.setMimeType(ContentService.MimeType.JSON);
}
I attempt to throw in parameters to view them within Postman and no matter what I do, the output is empty.
[{
"contentLength": -1,
"parameter": {},
"parameters": {},
"queryString": "",
"contextPath": ""
}][1]
My goal is this: How to get anything to show up in the parameters object?
Within Postman I am manually adding parameters and I replicated the same within my google browser. But it continues to be an empty object being returned.
What am I missing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
参数和参数属性是空对象,因为用于执行http get call的URL不包括查询字符串,
而不是使用
https:// .../exec
使用
> https:// .../exec?givenname = john& surname = doe
参数属性为
{givenname:'john',姓氏:'doe'}
。参数属性为
{vivenname:['john'],姓氏:['doe']}
。资源
The parameter and parameters properties are empty objects because the URL used to do the HTTP GET call doesn't include a query string
Instead of using
https://... /exec
use something like
https://... /exec?givenName=John&surname=Doe
The parameter property is
{givenName:'John',surname:'Doe'}
.The parameters property is
{givenName:['John'],surname:['Doe']}
.Resources