there is such a JSON: https://restcountries.com/v3.1/all I just want to have a choice "translations" -> "ita" -> "common"
HTTPBuilder getHttpBuilder() {
new HTTPBuilder('https://restcountries.com/')
}
def http = httpBuilder.request(Method.GET, ContentType.JSON){
uri.path = 'v3.1/all'
uri.query = [fields: 'translations,ita,common']
response.success = { resp, json ->
log.error(json.toString()) //string
log.error(JsonOutput.toJson(json).br) //json
log.error(JsonOutput.prettyPrint(JsonOutput.toJson(json))) //formated json
}
}
but I always get either a general view or nothing of what is needed Help me to understand! Thank you!