0
HTTPBuilderのURLからJSONを取得しようとしましたが、このコードは例外を返して、このerroを返します。 "メソッドは 'groovy.lang.MissingPropertyException'例外をスローしました。Test API Grails
static request(String path, boolean isGet){
def myClient = new HTTPBuilder("${HOST}${path}")
def jsonResp = [:]
try{
if(isGet){
log.info "[EXAMPLE GET] ${HOST}${path}"
myClient.get(requestContentType: ContentType.JSON){ resp, json ->
jsonResp = resp
}
}
}catch(Exception e){
println "erro: "
log.info "[EXAMPLE ERROR]: ${e.message}"
println(e.message)
}
jsonResp
}