在nodejs中传递下一页令牌后无法访问google places api

时间:2014-06-27 06:39:21

标签: node.js https google-places-api

您好我尝试使用nodejs client

访问belo url
  

https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=12.8441975,80.223766&radius=500&types=restaurant&key=Afghghghghghg&pagetoken=dghdghghgdhghgh

我使用普通的https客户端代码进行访问。当我在没有传递页面令牌的情况下点击网址时它工作正常。但是当我通过时我得到如下错误

  

无效请求

不知道我哪里出错了。非常感谢任何帮助。

1 个答案:

答案 0 :(得分:4)

这两个请求之间经过了多长时间?我发现在pagetoken请求之前可能需要两秒钟的延迟。

  

发出next_page_token和有效时间之间会有短暂的延迟。在可用之前请求下一页将返回INVALID_REQUEST响应。使用相同的next_page_token重试请求将返回下一页结果。

https://developers.google.com/places/documentation/search#PlaceSearchPaging