Hi
I'm a bit confused about a DELETE on a resource. When i do a DELETE
request (../test/123) the removeIt method is called but the PathParam
("id") is null.
If i remove the @GET getIt method from the class then the id is not null,
it then contains the value "123".
What am i missing ?
Using wink 1.1.2 on WebSphere 7.0.0.15
@Path("test")
public class TestResource {
@GET
@Produces(MediaType.APPLICATION_JSON)
@Path("{id}")
public String getIt(@PathParam("id") String ruleId,
@QueryParam("layout") String layout) {
System.out.println("GET id: " + id);
return "get " + id;
}
@POST
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public String storeIt(String jsonString) {
System.out.println("POST: " + jsonString);
return "store " + jsonString;
}
@DELETE
@Path("{id}")
public Response removeIt(@PathParam("id") String id) {
System.out.println("id: " + id);
return Response.status(Response.Status.OK).build();
}
}
Thanks.
Stefan.