HTTPBuilder get method with closure parameter return MissingMethodException
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.
It's IDE's problem, Eclipse groovy plugin not works very well.
精彩评论