GASでfetchを使う
Google Apps Scriptでは、fetchに相当するUrlFetchApp.fetch()を使う
GETする
code:js
const response = UrlFetchApp.fetch('https://...', {
method: ...,
headers: ...,
payload: ...,
});
全て同期処理で実行される
第2引数にoptionsを渡すところはFetch APIと同じ
bodyではなくpayloadなので注意
結果の受け取り
jsonで受け取る
JSON.parse(response.getContentText());
エラーもresponseで受けたいときは、muteHttpExceptionsをtrueにする
複数のfetchを同時に実行したいときはUrlFetchApp.fetchAll()を使う
Reference
Class UrlFetchApp  |  Apps Script  |  Google Developers