Lets say I have the following REST method:
@GET
@Path("get/{id}")
@Produces({"application/json", "application/xml"})
public Entity getEntity(@PathParam("id") int id) {
//do stuff
Entity entity = find(id);
return entity;
}
When I hit the rest endpoint with any browser by default I get back XML. Is there a way I can specify at the request which media type I want returned? or must I somehow include that information in the path?