我正在尝试向android发出指示api的请求。我已经构建了我的请求URL,如下所示:
https://maps.googleapis.com/maps/api/directions/json?mode=driving&transit_routing_preference=less_driving&origin=12.84938,77.6554783&destination=151,+9th+Main+Road,+HSR+Layout+Sector+6,+Bengaluru,+Karnataka+560102&key=MYAPI_KEY
但在测试端点时,我收到此错误:
{
"error_message" : "This IP, site or mobile application is not authorized to use this API key. Request received from IP address 223.227.127.66, with empty referer",
"routes" : [],
"status" : "REQUEST_DENIED"
}
我看过类似的其他问题,并且提到了server key and browser key
。如何获取服务器密钥?是否与我在注册directions or maps api
时收到的api密钥相同?
谢谢你的帮助。