1

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.

Dave Newton
  • 158,873
  • 26
  • 254
  • 302
Xilang
  • 1,513
  • 3
  • 18
  • 36
  • Works fine for me; what versions of everything are you using? Also, the stack trace/some context is helpful. – Dave Newton Oct 09 '11 at 05:41
  • I think it's may be my IDE's problem, I use Spring Tool Suite 2.6. The exception information is that it can not find method public Object get(Map args, Closure responseClosure) – Xilang Oct 10 '11 at 03:45

1 Answers1

1

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

Xilang
  • 1,513
  • 3
  • 18
  • 36