我试图用UrlFetchApp Google Scripts API制作一个网页浏览器。然而,查询字符串为 ?url="https://google.com"
它给我这个错误。
Exception: Invalid argument: "https://google.com" (line 3, file "Code")
但是当我用 param
在我下面的代码中,用于 https:/google.com确切的param值,不知为什么它工作得很好。
这是我的代码。
function doGet(e) {
var param = e["parameter"]["url"];
var response = UrlFetchApp.fetch(param);
return HtmlService.createHtmlOutput(response);
}
谢谢你的帮助!
这个修改怎么样?
我想在你的Web Apps脚本中,双引号是不需要的。
?url="https://google.com"
?url=https://google.com
或者,当使用URL编码的时候,就变成了下面这样。
?url=https%3A%2F%2Fgoogle.com