1
@Grab('com.github.groovy-wslite:groovy-wslite:1.1.2')
import wslite.rest.*
String key = 'my-key'
def client = new RESTClient('https://maps.googleapis.com/maps/api/directions/')
def response = client.get(path: 'xml',
query: [
origin: 'Disneyland',
destination: 'Universal Studios Hollywood',
sensor: 'false',
mode: 'driving',
key: 'my-key'
])
println response.DirectionsResponse.status
println response.DirectionsResponse.summary
RESTをGroovyで使用してGoogle APIの指示を使用しようとしていますが、response.DirectionsResponseから印刷できないようです。 nullまたはエラーを出力します。何か不足していますか?私はどこでも答えを探してみましたが、見つけられませんでした。Google Maps Directions API GroovyでRESTを使用する