Reputation: 707
Hey i have this talk to do:
http://localhost:8983/solr/select/?q=tree
What is the best way to do that? I would like some hints on this. Thanks in advanced, RR
Ps. i searched for it in here, but i found examples too complex to understand.
Upvotes: 1
Views: 5822
Reputation: 171154
Does:
def json = new JsonSlurper().parseText( new URL( 'http://localhost:8983/solr/select/?q=tree' ).text )
Get you to where you want to be?
Right, so this is Grails prior to 2.0, so can't use JsonSlurper
as that needs Groovy 1.8+
Can you try:
def json = grails.converters.JSON.parse( new URL( 'http://localhost:8983/solr/select/?q=tree' ).text )
Upvotes: 7