...
The next examples only show the body changed code
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
User us = new User("penny", "leonard");
ClientConfig clientConfig = new DefaultClientConfig();
clientConfig.getFeatures().put(
JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE);
Client client = Client.create(clientConfig);
WebResource webResource = client
.resource("http://localhost:8084/dbwstier/dbrest/user/du");
ClientResponse response = webResource.accept("application/json")
.type("application/json").delete(ClientResponse.class, us);
if (response.getStatus() != 200)
{
throw new RuntimeException("Failed : HTTP error code : "
+ response.getStatus());
}
String output = response.getEntity(String.class);
System.out.println("Server response .... \n");
System.out.println(output); |