Jersey test - Http Delete method with JSON request
问题 I am using Jersey Test to test Rest service DELETE method: @DELETE @Path("/myPath") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public MyResponse myMethod(MyRequest myRequest) { I have tried the example below and other methods: Entity<MyRequest> requestEntity = Entity.entity(new MyRequest(arg1, arg2), MediaType.APPLICATION_JSON); target(MY_URI).request(MediaType.APPLICATION_JSON).method("DELETE", requestEntity) and target(MY_URI).request(MediaType.APPLICATION