Google maps api 3 使用Google Places进行批处理:可能吗?

Google maps api 3 使用Google Places进行批处理:可能吗?,google-maps-api-3,google-places-api,google-api-client,Google Maps Api 3,Google Places Api,Google Api Client,我想知道是否可以将批量请求发送到maps.googleapis.com。据我所知,它不是 我使用的是支持批处理的,但它只适用于www.googleapis.com。我继续攻击它,这样我就可以打电话了,对于正常的电话来说,它工作得很好,但是当我实际尝试批量处理它们时,我得到了一个404错误: “在此服务器上找不到请求的URL/batch。我们只知道这些。” 因此,maps.googleapis.com似乎不支持批处理,但我想确定这是真的。如果有人不知道,请告诉我怎么做。谢谢 内部谷歌api php

我想知道是否可以将批量请求发送到
maps.googleapis.com
。据我所知,它不是

我使用的是支持批处理的,但它只适用于
www.googleapis.com
。我继续攻击它,这样我就可以打电话了,对于正常的电话来说,它工作得很好,但是当我实际尝试批量处理它们时,我得到了一个404错误:

“在此服务器上找不到请求的URL
/batch
。我们只知道这些。”

因此,
maps.googleapis.com
似乎不支持批处理,但我想确定这是真的。如果有人不知道,请告诉我怎么做。谢谢

内部谷歌api php客户端/src/google/Config.php

-      'base_path' => 'https://www.googleapis.com',
+      'base_path' => 'https://maps.googleapis.com',
<?php

const API_KEY = 'MY_API_KEY';

set_include_path("google-api-php-client/src/" . PATH_SEPARATOR . get_include_path());
require_once 'Google/Client.php';
require_once 'Google/Service/Maps.php';
require_once 'Google/Http/Batch.php';

$client = new Google_Client();
$client->setApplicationName("Client_Library_Examples");
$client->setDeveloperKey(API_KEY);

$client->setUseBatch(true);
$batch = new Google_Http_Batch($client);

$service = new Google_Service_Maps($client);

$inputs = array(
    'Dolore',
    'MacAl',
    'App Aca'
);

foreach($inputs as $input) {
    $req = $service->places->autocomplete($input, 37.7833, -122.4167, 500);
    $batch->add($req, $input);
}

$results = $batch->execute();

print_r($results);

print_r($req);
谷歌api php客户端/src/google/Service/Maps.php

-      'base_path' => 'https://www.googleapis.com',
+      'base_path' => 'https://maps.googleapis.com',
<?php

const API_KEY = 'MY_API_KEY';

set_include_path("google-api-php-client/src/" . PATH_SEPARATOR . get_include_path());
require_once 'Google/Client.php';
require_once 'Google/Service/Maps.php';
require_once 'Google/Http/Batch.php';

$client = new Google_Client();
$client->setApplicationName("Client_Library_Examples");
$client->setDeveloperKey(API_KEY);

$client->setUseBatch(true);
$batch = new Google_Http_Batch($client);

$service = new Google_Service_Maps($client);

$inputs = array(
    'Dolore',
    'MacAl',
    'App Aca'
);

foreach($inputs as $input) {
    $req = $service->places->autocomplete($input, 37.7833, -122.4167, 500);
    $batch->add($req, $input);
}

$results = $batch->execute();

print_r($results);

print_r($req);
(我添加此文件是为了使Places调用成为可能。)


使用Places API时出现了什么错误?可能是一个示例请求?在每秒或每天的请求数方面,您是否会遇到一些API限制?这不是请求限制。找不到错误404。除了调用
/batch
发出批处理请求外,我没有收到此错误。