我想使用诺基亚 Here 地图获取有关城市中某个地方的一些数据。因此我想执行一个 curRL 请求。我正在构建这样的 cURL 请求:
$postFields = array ( "app_id" => self::APP_ID, "app_code" => self::APP_CODE, "at" => $latLon['lat'] . "," .$latLon['lon'], "q" => $term, "pretty" => "true");
$this->_curl->setUrl ( $this->getUrl() );
$this->_curl->setPostField ( $postFields );
$curlResults = $this->_curl->execute();
var_dump ( $curlResults );
但是当我在浏览器中执行此操作时,我得到
"{"status":401,"message":"Missing authentication parameters"}"
但是,当我打印出整个东西时。就像构建查询一样
echo $this->getUrl() . "?app_id=" . self::APP_ID, "&app_code=" . self::APP_CODE . "&at=" . $latLon['lat'] . "," .$latLon['lon'] . "&q=" . $term . "&pretty=" . "true";
它可以正常工作。为什么诺基亚告诉我我缺少身份验证参数?
这就是查询字符串
http://places.nlp.nokia.com/places/v1/discover/search?app_id=XXXXXXX&app_code=XXXXXXX&at=51.2151915838703%2C6.76354323416523&q=Rewe&pretty=true