Cyrillic address request using Google Geocoding API
-
24-05-2021 - |
質問
I'm learning how to use google geocoding API in java. I've decided to use json format response, but faced some difficulties. An app should convert string address to latitude and longitude.
The example adress from google documentation (1600 Amphitheatre Parkway, Mountain View, CA) works just fine, but when I'm trying to request by adress in Cyrillic (for ex. 12 Пушкина, Москва), I get
INVALID_REQUEST
status.
I should notice, that the same request works fine in browser. So I wonder if there any way to request by Cyrillic address from java.
解決
You'll need to encode the address for use in a URL. I can't tell you which method to use in java(but I'm sure there is one).
In the end it should look like this:
所属していません StackOverflow