We would usually define POST and PUT verbs as different service APIs.
@POST
@Path("/getbook")
@Produces({"application/xml","application/json"})
@Consumes({"application/xml","application/json","application/x-www-form-urlencoded"})
public Response getBucket() {
... }
@PUT
@Path("/getbook/{name}")
@Produces({"application/xml","application/json"})
@Consumes({"application/xml","application/json","application/x-www-form-urlencoded"})
public Response getBucket(@PathParam("name") String name) {
... }
Would there be a way to combine these verbs into a single method - and then drive different logic based on the type of the verb ? Hypothetically
@POST
@PUT
@Path("/getbook/{name}")
@Produces({"application/xml","application/json"})
@Consumes({"application/xml","application/json","application/x-www-form-urlencoded"})
public Response getBucket(@PathParam("name") String name) {
if(verb=POST){
... }
else{
}
}