Hi Eric,
I have tried the jax-rs @Produces annotation both at method and class levels as shown here (
http://docs.oracle.com/cd/E19798-01/821-1841/gipzh/index.html) and it works for me. I don't have to specify the Content-Type header in the request.The resource method or endpoint is chosen according the Accept header.
method level
@GET
@Produces({"application/vnd.aerogear.v101+json"})
public List<Member> listAllMembers() {
return repository.findAllOrderedByName();
}
@GET
@Produces({"application/vnd.aerogear.v102+json"})
public List<Member> listAllMembersNew() {
return null;
}
class level
@Path("/members")
@RequestScoped
@Produces({"application/vnd.aerogear.v102+json"})
public class MemberResourceRESTServiceV102 {
@Path("/members")
@RequestScoped
@Produces({"application/vnd.aerogear.v101+json"})
public class MemberResourceRESTService {