有没有人使用过融合表 API 中的 importRows() 函数?作为下面的 API 参考, https://developers.google.com/fusiontables/docs/v1/reference/table/importRows 我必须在请求正文中提供 CSV 数据。但是我应该为 html 正文做些什么呢?
我的代码:
http = getAuthorizedHttp()
DISCOVERYURL = 'https://www.googleapis.com/discovery/v1/apis/{api}/{apiVersion}/rest'
ftable = build('fusiontables', 'v1', discoveryServiceUrl=DISCOVERYURL, http=http)
body = create_ft(CSVFILE,"title here") # the function to load csv file and create the table with columns from csv file.
result = ftable.table().insert(body=body).execute()
print result["tableId"] # good, I have got the id for new created table
# I have no idea how to go on here..
f = ftable.table().importRows(tableId=result["tableId"])
f.body = ?????????????
f.execute()