FAQ Database Discussion Community

JsonSlurper returns No signature of method: groovy.json.JsonSlurper.parseText() is applicable for argument types: (java.util.ArrayList)

I'm trying to parse JSON file with JsonSlurper.parseText but keep getting similar problems. def jsonParse = null def http = new HTTPBuilder(url) http.auth.basic(username, password) http.request(Method.GET) { response.success = { resp, reader ->; jsonParse = new JsonSlurper().parseText(reader) } } Whenever I run my application the error message says No signature of...

JSONException error Grails

Paring JSON file, using JsonSlurper My code is like below String url = 'https://urlThatIWantToGoto' String jsonFile = new JsonSlurper.parseText(new URL(url).text)) JSONArray jsonParse = new JSONArray(jsonFile) Whenever I run this code, I get a error printing as following Caught: org.codehaus.groovy.grails.web.json.JSONException: Expected a ',' or '}' at character 982 of "MyJSONFile" Funny...