Google maps geocoding API inconsistent
I have a server application that calls the google maps geocoding API at http://maps.googleapis.com/maps/api/geocode/json
I experience that 开发者_开发知识库when the server application invokes such an URL, the response is sometimes ZERO_RESULTS.
If I take the exact same URL and paste in a browser, I get a valid result back.
Any ideas to what differences can cause this? HTTP headers? Something else?
In the link you provided it is missing the address, components, latlng or place_id parameters, besides the Google Map API KEY.
You need at least one of the parameters and the Key to get a proper response.
e.g.
https://maps.googleapis.com/maps/api/geocode/json?place_id=ChIJ1xwGTLE1K4gRmzFDd_1HzPc&key=xxx
Just add your KEY and it should work.
精彩评论