RosettaCodeData/Task/JSON/EGL/json-4.egl
2023-07-01 13:44:08 -04:00

15 lines
595 B
Text

// Service function definition
function geocode(address String) returns (GoogleGeocoding) {
@Resource{uri = "binding:GoogleGeocodingBinding"},
@Rest{method = _GET, uriTemplate = "/json?address={address}&sensor=false",
requestFormat = None, responseFormat = JSON}
}
// Invoke service function
call geocode("111 Maple Street, Somewhere, CO") returning to callback;
function callBack(result GoogleGeocoding in)
SysLib.writeStdout(result.status);
SysLib.writeStdout(result.results[1].geometry.location.lat);
SysLib.writeStdout(result.results[1].geometry.location.lng);
end