Spring 谷歌地图API在Chrome和RestTemplate之间具有不同的结果
该服务正在使用google maps api() 当我使用SpringRESTTemplate的默认bean配置执行GET时,我的值与在web浏览器(Chrome)上执行GET时的值不同 调用Chrome并使用resttemplate: 当我执行反向地理代码时,chrome的执行更加精确 结果: 铬: RestTemplate:Spring 谷歌地图API在Chrome和RestTemplate之间具有不同的结果,spring,google-maps,java-8,google-api,resttemplate,Spring,Google Maps,Java 8,Google Api,Resttemplate,该服务正在使用google maps api() 当我使用SpringRESTTemplate的默认bean配置执行GET时,我的值与在web浏览器(Chrome)上执行GET时的值不同 调用Chrome并使用resttemplate: 当我执行反向地理代码时,chrome的执行更加精确 结果: 铬: RestTemplate: location: { lat: -23.5574375, lng: -46.5948733 }, 我试过使用Double、Float和BigDecimal
location: {
lat: -23.5574375,
lng: -46.5948733
},
我试过使用Double、Float和BigDecimal。我尝试在序列化之前创建一个反序列化程序来获取这个值,但是这个值是相同的
我正在使用Java8和SpringBoot2.0.3
有人知道如何精确吗?我使用的是UriComponentsBuilder,当我使用toUriString时,url被格式化为浏览器,无法正常工作
UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(googleHost)
.queryParam("key", apiKey)
.queryParam(input, address)
.queryParam("language", language);
它现在正在使用StringUtils.join(…)构建URI
String googleurl = StringUtils.join(googleGeocodingHost,
"?key=", apiKey, "&", input, "=", address, "&language=", language);
你应该为谷歌地图打开一个bug,但它是bug吗?或者我应该添加一个特定的反序列化程序?lng已正确反序列化。lat是不同的。@PavelMolchanov我正在使用Java反序列化。并不是因为没有错误来获取值,所以反序列化过程被正确执行。
String googleurl = StringUtils.join(googleGeocodingHost,
"?key=", apiKey, "&", input, "=", address, "&language=", language);