Google Spreadsheet API If-Match不会生效

时间:2014-06-09 19:19:26

标签: google-sheets google-spreadsheet-api google-data-api

似乎在HTTP标头If-Match中传递了etag,在行删除的情况下没有做任何事情。这就是我试过的:

curl --silent -X GET --header "GData-Version: 3.0" --header "Authorization: GoogleLogin auth=$TOKEN" https://spreadsheets.google.com/feeds/list/xxx/od6/private/full/cokwr | tidy -xml -indent -quiet | egrep "etag|title"
gd:etag='"YGdaHlAXHyt7Ig.."'>
  <title>TEST1</title>

Changed the cell. (The etag changed)

curl --silent -X GET --header "GData-Version: 3.0" --header "Authorization: GoogleLogin auth=$TOKEN" https://spreadsheets.google.com/feeds/list/xxx/od6/private/full/cokwr | tidy -xml -indent -quiet | egrep "etag|title"
gd:etag='"agoUURMYXyt7ImA."'>
  <title>TEST1-new</title>

curl --silent -X DELETE --header 'If-Match: "YGdaHlAXHyt7Ig.."' --header "GData-Version: 3.0" --header "Authorization: GoogleLogin auth=$TOKEN" https://spreadsheets.google.com/feeds/list/xxx/od6/private/full/cokwr | tidy -xml -indent -quiet

(The row got deleted)

https://developers.google.com/google-apps/spreadsheets/?csw=1#deleting_a_list_row

0 个答案:

没有答案