1
我想从诺基亚这里获取企业信息location api。以下是我的代码:诺基亚这里的位置api不能在php
$NokiaPlaceURL = 'http://places.nlp.nokia.com/places/v1/discover/search?app_id='.APP_ID.'&app_code='.APP_CODE.'&at='.$at.'&q='.$keyword.'&size=10';
//echo $NokiaPlaceURL; exit;
$NokiaPlaceURL = file_get_contents($NokiaPlaceURL);
var_dump($NokiaPlaceURL);exit;
它给出了以下错误。我该如何解决这个问题?
Warning: file_get_contents(http://places.nlp.nokia.com/places/v1/discover/search?app_id=---&app_code=---&at=40.708322%2C-74.008881&q=food&size=10) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 406 Not Acceptable in /opt/lampp/htdocs/test/nokia_here.php on line 29
bool(false)
感谢
HTTP标头的最终列表可以在[地方API文档]中找到(http://developer.here.com/docs/places/topics/http-request-headers.html)相关报价如下(重点是我的): _指定'application/json'产生json响应,而 'xhtml + xml'或等效(可能的通配符)导致类似于json的 HTML._ * *任何其他值将提示406响应。** – 2013-04-23 07:16:28
是的,我想链接,但与所有框架最接近的直接链接,不失去导航是开始部分。 – pilsetnieks 2013-04-23 10:57:37