次のコードは 400 Bad Request になります...明らかな問題はありますか?
$column = new Google_Column();
$column->setName('foo');
$column->setType('TEXT');
$table = new Google_Table();
$table->setName('bar');
$table->setColumns(array($column));
// $client below is a successfully authenticated Google_Client instance
$service = new Google_FusiontablesService($client);
$result = $service->table->insert($table); // 400 Bad Request exception thrown
Google_Client は「サービス アカウント」で認証されており、他のリクエストを$service->query->sql()
正常に実行できます。
Google API クライアントのバージョンは 0.6.2 (最新) です。
ありがとう。
更新:オブジェクト ダンプの要求:
Google_HttpRequest Object
(
[batchHeaders:Google_HttpRequest:private] => Array
(
[Content-Type] => application/http
[Content-Transfer-Encoding] => binary
[MIME-Version] => 1.0
[Content-Length] =>
)
[url:protected] => https://www.googleapis.com/fusiontables/v1/tables
[requestMethod:protected] => POST
[requestHeaders:protected] => Array
(
[content-type] => application/json; charset=UTF-8
[content-length] => 162
[authorization] => Bearer someHashHere
)
[postBody:protected] => {"columns":[{"name":"Project","type":"TEXT"}],"description":"Created on 2013-05-14 10:41:44","isExportable":"true","name":"foobar"}
[userAgent:protected] => My app name google-api-php-client/0.6.0
[responseHttpCode:protected] =>
[responseHeaders:protected] =>
[responseBody:protected] =>
[accessKey] =>
)