Please advise a good example for RESTful client using cxf/JAX-RS, JSON input
and POST.

So far, I've attempted the following but hitting a ClassNotFoundException
for a ClientException class so I'm unable to determine what the problem is
with the 2nd line of code:

String input =
"{\"foo\":\""+foo+"\",\"bar\":\"bar\",\"baz\":"+"\""+baz+"\",\"bah\":"+"\""+bah+"\"}";

WebClient wc = WebClient.create("http://"; + server + ":" + port +
"/myRoot");
wc.path("customers/" + a + "/" + b + "/relations");
wc.accept("application/json").type("application/json");
Response r = wc.post(input);

Is this the correct way of passing the JSON input as a String in the post
call to the JAX-RS web method?



--
View this message in context: 
http://cxf.547215.n5.nabble.com/example-for-RESTful-client-using-JSON-input-and-POST-tp5755148.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to