Thank you for the example. It got me further along. Now I am getting a 415
error from the server and I am not sure if it is on the client side or server
side. Here is my client code:
Button btnSendTest = new Button("Send Test");
final Label testLabel = new Label("Test Label");
final JSONObject jsonValue = new JSONObject();
jsonValue.put("text", new JSONString("Test"));
System.out.println(jsonValue.toString());
btnSendTest.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
ClientResource r = new ClientResource("test");
r.setOnResponse(new Uniform() {
public void handle(Request request,
Response response) {
try {
testLabel.setText(response.getEntity().getText());
} catch (IOException e) {
testLabel.setText(e.getMessage());
}
}
});
r.post(new
JsonRepresentation(MediaType.APPLICATION_JSON,jsonValue));
}
});
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2847286