Google maps Parse.com云代码谷歌地图API地理编码返回零结果
我编写了以下parse.com云代码函数:Google maps Parse.com云代码谷歌地图API地理编码返回零结果,google-maps,http,google-maps-api-3,parse-platform,geocoding,Google Maps,Http,Google Maps Api 3,Parse Platform,Geocoding,我编写了以下parse.com云代码函数: Parse.Cloud.define("googleApiLatLong", function(request, response) { Parse.Cloud.httpRequest({ url: "http://maps.googleapis.com/maps/api/geocode/json?address=Mannheim,Opernplatz", success: function(httpRespon
Parse.Cloud.define("googleApiLatLong", function(request, response) {
Parse.Cloud.httpRequest({
url: "http://maps.googleapis.com/maps/api/geocode/json?address=Mannheim,Opernplatz",
success: function(httpResponse) {
console.log(httpResponse.text);
response.success(httpResponse.text); // This will respond with the contents of the http response
},
error: function(httpResponse) {
console.error('Request failed with response code ' + httpResponse.status);
response.error('Request failed with response code ' + httpResponse.status);
}
});
});
现在它所做的只是调用一个函数并记录结果。URL是对谷歌地理编码API的请求,在浏览器中调用时返回JSON对象,但通过云代码调用时返回零结果
非常感谢您的帮助 您可以尝试使用
API密钥执行https
请求,请参阅以获取更多详细信息。@ztan但这并不是提供android系统API的真正目的。。。强制开发人员使用RESTAPI。。。