开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜