How to get the JSON object from the response using Groovy?

55 views
Skip to first unread message

Vijay

unread,
Jul 20, 2012, 1:21:42 AM7/20/12
to ne...@googlegroups.com
Hi all,

I am trying to run a Gremlin Script across Neo4j using Groovy. I am able to get the response, but the response in in JSON format.
How to get the JSON object from the response.
currently I am using Reader to print the response content.

body: 'script=' + "g.v(45);",
requestContentType: URLENC) { resp,reader -> 
println "--------- Printing Status --------"
println "Success! ${resp.status}"
println "----------Printing Content type----------"
println "${resp.headers.'Content-Type'}"
println "---------------------------------"
println reader
}

How to get the JSON object from the response. 

Thanks
Vijay


Peter Neubauer

unread,
Jul 20, 2012, 10:40:19 AM7/20/12
to ne...@googlegroups.com
Vijay,
that is nothing related to Neo4j, but more to Groovy and their JSON handling from your client. Maybe asking in the Groovy user lists or googling around Groovy will help?

/peter
--

Cheers,

/peter neubauer

G:  neubauer.peter
S:  peter.neubauer
P:  +46 704 106975
L:   http://www.linkedin.com/in/neubauer
T:   @peterneubauer

Wanna learn something new? Come to @graphconnect.
Reply all
Reply to author
Forward
0 new messages