回答編集履歴

1

レスポンスの確認について追記

2020/07/21 18:30

投稿

draq
draq

スコア2573

test CHANGED
@@ -81,3 +81,25 @@
81
81
  Class FormResponse
82
82
 
83
83
  [https://developers.google.com/apps-script/reference/forms/form-response](https://developers.google.com/apps-script/reference/forms/form-response)
84
+
85
+
86
+
87
+ ---
88
+
89
+ (レスポンスの確認について追記)
90
+
91
+ > UrlFetchApp.fetch の戻り値(レスポンス)の確認とはどのような操作を行えばよいのでしょうか。
92
+
93
+
94
+
95
+ ```JavaScript
96
+
97
+ const response = UrlFetchApp.fetch( .... );
98
+
99
+ if(response.getResponseCode() !== 200) {
100
+
101
+ throw new Error(response.getContentText());
102
+
103
+ }
104
+
105
+ ```