0
我得到這個錯誤,但我的方法看起來完全沒有給我HTTPBuilder不接受錯誤
def http = new HTTPBuilder()
http.request(
'https://textalytics-topics-extraction-11.p.mashape.com/topics-1.2?txt=ben',
Method.GET,
ContentType.JSON
) { req ->
headers."X-Mashape-Key" = "mashkey"
response.success = { resp, reader ->
assert resp.statusLine.statusCode == 200
println "Got response: ${resp.statusLine}"
println "Content-Type: ${resp.headers.'Content-Type'}"
println reader.text
}
response.'404' = {
println 'Not found'
}
}
什麼想法?
你得到了什麼錯誤? – Opal 2014-09-02 16:51:02