groovy RESTClient 0.6 を使用して POST リクエストを作成しています。応答には XML ペイロードが含まれているはずです。次のコードがあります。
def restclient = new RESTClient('<some URL>')
def headers= ["Content-Type": "application/xml"]
def body= getClass().getResource("/new_resource.xml").text
/*
If I omit the closure from the following line of code
RESTClient blows up with an NPE..BUG?
*/
def response = restclient.post(
path:'/myresource', headers:headers, body:body){it}
println response.status //prints correct response code
println response.headers['Content-Length']//prints 225
println response.data //Always null?!
response.data は常に null ですが、Google chrome のポストマン クライアントを使用して同じリクエストを試行すると、期待されるレスポンス ボディが返されます。これは RESTClient の既知の問題ですか?