Google 电子表格 API v4 文档似乎为 batchUpdate 列出了不正确的 URL。
文档列出:
POST https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}/values:batchUpdate
但是下面的代码
let range = "Sheet1!A\(index):\(index)"
let url = String(format:"%@/%@/values:batchUpdate/%@", baseUrl, spreadsheetId, range)
let params = ["valueInputOption":"RAW"]
let fullUrl = GTLUtilities.URLWithString(url, queryParameters: params)
let body = GTLObject()
body.JSON = ["majorDimension":"ROWS",
"values": [values]]
driveService.fetchObjectByUpdatingObject(body, forURL: fullUrl, completionHandler: {
(ticket:GTLServiceTicket!, object:AnyObject!, error:NSError!) in
结果是
<p>The requested URL <code>/v4/spreadsheets/....values:batchUpdate/Sheet1!A4:4?valueInputOption=RAW</code> was not found on this server. <ins>That’s all we know.</ins>
在这种情况下使用的正确 URL 是什么?