I am trying to send a request to the following resource, but I get a HTTP 405 method not allowed
.
@Path("/areas")
@Api(tags = "Managin aareas")
@Produces({ MediaType.APPLICATION_JSON })
public interface AreaResource
{
@GET
@ApiOperation(value = "Gets all the areas")
Response getareas(@Context UriInfo uriInfo);
@GET
@Path("/{"+Constants.ID+"}")
@ApiOperation(value = "Finds an area by id")
Response getAreaById(@PathParam(Constants.ID) String id);
@POST
@Consumes(MediaType.APPLICATION_JSON)
@ApiOperation(value = "Creates a new Area")
Response createArea(Area area);
}
I have moved @Consumes(MediaType.APPLICATION_JSON)
to be on top of only createArea
but I still get a 405 method not allowed error. What might the problem?
Thanks!