使用此处的代码http://fusion-tables-api-samples.googlecode.com/svn/trunk/ftapi/ [1]我可以通过运行[2] cat PATHTOMYDATA.csv | ./ftupload.sh MYTABLEID
来生成成功的响应。但我发现MYTABLEID指定的Fusion Table没有变化
我尝试过的一些事情:
-upload到具有正确列数的新空白表...相同的结果
-upload到其他表的列数不正确...收到有关列的错误
- ftupload.sh中对curl命令的各种修改[3]
--remove -s -S(这样可以获得完整输出)......相同的结果
- 将文件作为参数而不是流式标准输入[4] ......相同的结果
- 没有--data-binary
标志的发送..产生HTTP / 1.1 405方法不允许
- 使用-v
标志发送,生成以下HTTP请求日志[5]
[1]其功能与http://fusion-tables-api-samples.googlecode.com/svn/trunk/ftapi相同,因为该代码不会从rev56更改为rev57
[2]关于bash / Ubuntu
[3]最初:
curl -s -S --data-binary @- -H "Authorization: Bearer $access_token" \
-H "Content-Type: application/octet-stream" \
"https://www.googleapis.com/upload/fusiontables/v1/tables/$1/import"
[4]
curl -s -S --data-binary @PATHTOMYDATA.csv -H "Authorization: Bearer $access_token" \
-H "Content-Type: application/octet-stream" \
"https://www.googleapis.com/upload/fusiontables/v1/tables/$1/import"
[5]
* About to connect() to www.googleapis.com port 443 (#0)
* Trying 74.125.29.95... connected
* successfully set certificate verify locations:
* CAfile: none
CApath: /etc/ssl/certs
* SSLv3, TLS handshake, Client hello (1):
* SSLv3, TLS handshake, Server hello (2):
* SSLv3, TLS handshake, CERT (11):
* SSLv3, TLS handshake, Server key exchange (12):
* SSLv3, TLS handshake, Server finished (14):
* SSLv3, TLS handshake, Client key exchange (16):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSL connection using ECDHE-RSA-RC4-SHA
* Server certificate:
* subject: C=US; ST=California; L=Mountain View; O=Google Inc; CN=*.googl eapis.com
* start date: 2013-06-19 12:43:04 GMT
* expire date: 2013-10-31 23:59:59 GMT
* subjectAltName: www.googleapis.com matched
* issuer: C=US; O=Google Inc; CN=Google Internet Authority
* SSL certificate verify ok.
> POST /upload/fusiontables/v1/tables/MYTABLEID/import HTTP/1.1
> User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zli b/1.2.3.4 libidn/1.23 librtmp/2.3
> Host: www.googleapis.com
> Accept: */*
> Authorization: Bearer ya29.AHES6ZTZG_aqdYJYg-JgeAMOHOQIJOYFWAaGzzDWDlP2OKzpof8 MIkuPUA
> Content-Type: application/octet-stream
> Content-Length: 50
>
* upload completely sent off: 50out of 50 bytes
< HTTP/1.1 200 OK
< ETag: "TMh8SguO4XpkjXICbs8TpuVjR5I/BKKfZXT4y10ldV7sI6nrMgeYYNw"
< Content-Type: application/json
< Content-Length: 60
< Date: Fri, 28 Jun 2013 15:09:00 GMT
< Server: HTTP Upload Server Built on Jun 25 2013 11:32:14 (1372185134)
<
{
"kind": "fusiontables#import",
"numRowsReceived": "1"
}
* Connection #0 to host www.googleapis.com left intact
* Closing connection #0
* SSLv3, TLS alert, Client hello (1):
答案 0 :(得分:0)
有一个错误吞噬了第一行上传API。它于2013年4月左右推出,并于2013年8月1日确定。