Question

below code:

def http = new HTTPBuilder( 'http://twitter.com/statuses/' )

http.get( path: 'user_timeline.json', 
    query: [id:'httpbuilder', count:5] ) { resp, json ->

    println resp.status

    json.each {  // iterate over JSON 'status' object in the response:
        println it.created_at
        println '  ' + it.text
    }
}

Why get exception? I use the same code from http://groovy.codehaus.org/modules/http-builder/doc/json.html, it should works.

Was it helpful?

Solution

It's IDE's problem, Eclipse groovy plugin not works very well.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top