【发布时间】:2021-08-16 01:27:03
【问题描述】:
我正在尝试通过将工作表内容调用为 json 端点来加载它。
fetch("https://spreadsheets.google.com/feeds/list/MYSHEETID/1/public/values?alt=json")
.then(res => res.json())
.then(json => {
const data = [] /* this array will eventually be populated with the contents of the spreadsheet's rows */
我正在使用https://benborgers.com/posts/google-sheets-json中描述的方法
它在大约 30% 的时间里工作,而我在另外 70% 的时间里得到 404。我已经为此苦苦挣扎了好几天,不知道为什么会失败。
【问题讨论】:
-
我今天也多次收到此错误...我已将控制台日志记录添加到应用程序以跟踪和输出
fetch的结果,并注意到它有时有效,有时无效。也许是谷歌的问题? (我现在无法为此构建调试测试,因此无法确认) -
能否提供完整的代码?