0
我在this script中實現了以下幾行。從另一個腳本獲取JSON輸出
return ContentService
.createTextOutput(JSON.stringify(data))
.setMimeType(ContentService.MimeType.JSON);
他們返回{"title":"My book","description":"Memories"}
我可以看到URL的變化。
我也寫了一個腳本來獲取這些信息。它包含以下行:
UrlFetchApp.fetch(wsURL).getContentText();
出於某種原因,我收到以下HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta content="width=300, initial-scale=1" name="viewport">
<meta name="description" content="Google Drive is a free way to keep your files backed up and easy to reach from any phone, tablet, or computer. Start with 15GB of Google storage – free.">
<meta name="google-site-verification" content="LrdTUW9psUAMbh4Ia074-BPEVmcpBxF6Gwf0MSgQXZs">
<title>Meet Google Drive – One place for all your files</title>
<style> @font-face { font-family: 'Open Sans'; font-style: normal; font-weight: 300; src: local('Open Sans Light'), local('OpenSans-Light'), url(//fonts.gstatic.com/s/opensans/v13/DXI1ORHCpsQm3Vp6mXoaTYnF5uFdDttMLvmWuJdhhgs.ttf) format('truetype');
.........................
}); })();
</script>
</body>
</html>
我不知道爲什麼它返回這個HTML。如何讓我的Google腳本接收外部腳本的輸出JSON?