该/geocode
端点返回即使在提供有效证书401。
以下要求:
GET /6.2/geocode.json?app_code=MY_APP_CODE& app_id=MY_APP_ID& searchtext=test HTTP/1.1
Host: geocoder.api.here.com
cache-control: no-cache
收益:
<ns2:Error xmlns:ns2="http://www.navteq.com/lbsp/Errors/1" type="PermissionError" subtype="InvalidCredentials">
<Details>invalid credentials for MY_APP_ID</Details>
</ns2:Error>
我在一个免费增值计划,我得到上述回应时,我用我的app_id
&app_code
。
编辑:看来演示凭证是特定域,添加具有Referer
作为值请求成功一个https://developer.here.com
报头。但在app_id
&app_code
交换用我自己的凭据(不接触任何其他参数),我突然接到了401(即其他一些参数都borking要求基本上排除的可能性)之后。
演示应用程序ID和代码被设置为特定域和具有到期日设置。所以,它不需要在您的浏览器一定的工作。你应该用你自己的凭据。用我自己的凭据,下面的例子查询我能够得到响应。
https://geocoder.api.here.com/6.2/geocode.json?searchtext=200%20S%20Mathilda%20Sunnyvale%20CA&app_id=xxxx&app_code=xxxx&gen=9
响应:
Response
MetaInfo
Timestamp "2019-02-05T13:10:09.436+0000"
View
0
_type "SearchResultsViewType"
ViewId 0
Result
0
Relevance 1
MatchLevel "houseNumber"
MatchQuality
State 1
City 1
Street
0 0.9
HouseNumber 1
MatchType "pointAddress"
Location
LocationId "NT_nL.dzNwdSJgdcF4U8dYEiC_yADM"
LocationType "address"
DisplayPosition
Latitude 37.37634
Longitude -122.03405
NavigationPosition
0 {…}
MapView
TopLeft {…}
BottomRight {…}
Address
Label "200 S Mathilda Ave, Sunn…CA 94086, United States"
Country "USA"
State "CA"
County "Santa Clara"
City "Sunnyvale"
District "Heritage District"
Street "S Mathilda Ave"
HouseNumber "200"
PostalCode "94086"
AdditionalData […]