0

我正在尝试通过coldfusion使用google places api将地点添加到google maps,我已经在API设置中启用了地点,并且正在使用正确的密钥,因为我能够搜索100米半径内的地点。

当我尝试添加一个地方时,我在 return 语句中得到“INVALID_REQUEST”。

代码如下:

<cfsavecontent variable="variables.addString">
  <?xml version="1.0" encoding="UTF-8"?>
  <PlaceAddRequest>
      <location>
          <lat><cfoutput>#variables.lat#</cfoutput></lat>
          <lng><cfoutput>#variables.lng#</cfoutput></lng>
      </location>
      <accuracy>20</accuracy>
      <name><cfoutput>#variables.placeName#</cfoutput></name>
  </PlaceAddRequest>
</cfsavecontent>

<cfhttp
    url='https://maps.googleapis.com/maps/api/place/add/xml?sensor=false&key=#variables.googlekey#'
    method="POST"
    useragent="#CGI.http_user_agent#"
    result="objGet"
>

<cfhttpparam
    type="XML"
    value="#Trim(variables.addString)#"
/>
</cfhttp>

有谁知道这里出了什么问题?

4

2 回答 2

0

缺少类型参数。这是一个必需的参数,即使它在参考文档中没有这样记录。我已经提交了一个错误来修复文档。希望有帮助。

于 2012-01-17T23:30:42.353 回答
0

是什么variables.addString.Trim()?你的意思是trim(variables.addString)

于 2011-12-19T18:07:47.537 回答