[英]Directions API Request Denied Android Client
我正在嘗試從Android向路線API發出請求。 我已經構造了我的請求網址,如下所示:
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密鑰不同嗎?
謝謝你的幫助。
Direction API需要IP限制,如果您指定Android限制,則使用Android,它將響應為“ request_denied”
因此,您需要中間服務器,然后需要限制使用服務器IP。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.