0

使用此处的代码http://fusion-tables-api-samples.googlecode.com/svn/trunk/ftapi/ [1] 我可以通过运行 [2] 产生成功的响应cat PATHTOMYDATA.csv | ./ftupload.sh MYTABLEID。但我发现 MYTABLEID 指定的 Fusion Table 没有变化

我尝试过的一些事情:-上传到具有正确列数的新空白表...相同的结果-上传到列数不正确的其他表...收到有关列的错误-ftupload 中 curl 命令的各种修改.sh [3] --remove -s -S(这样可以获得完整的输出)...相同的结果--将文件作为参数而不是流式标准输入 [4] ...相同的结果--不带--data-binary标志发送..产生 HTTP/1.1 405 Method Not Allowed
--sending with -vflag,产生以下 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):
4

1 回答 1

0

有一个错误吞噬了从 API 上传的第一行。它于 2013 年 4 月左右推出,并于 2013 年 8 月 1 日修复。

于 2013-08-01T16:42:51.677 回答