これは些細なことですが、どういうわけか私にとってはうまくいきません。Camel でホストされている RESTLET サーバーを呼び出そうとしています。Camelクライアントで動作しますが、同じものを裸のApache HTTPクライアントで動作させようとしています。Camel is client は次のとおりです。
CamelContext context = new DefaultCamelContext();
Map<String, Object> headers = new HashMap<String, Object>();
context.createProducerTemplate().requestBodyAndHeaders("restlet:http://localhost:8086/Bookmarkee/boolean/V2?restletMethod=post", "Halleluia",headers);
私が動作させようとしている HTTP クライアントは次のとおりです。
HttpPost httppost = new HttpPost("http://localhost:8086/Bookmarkee/boolean/V2?restletMethod=post");
StringEntity e= new StringEntity("Halleluia",ContentType.create("text/plain", "UTF-8"));
httppost.setEntity(e);
CloseableHttpResponse response = httpclient.execute(httppost);
ただし、サーバーでは、応答はサーブレット エンジンによってストリームから読み取られません。その結果、コンポーネントに文字列ではなく入力ストリームが渡されます。
どんな手掛かり?