Reputation: 3056
What's the different between Jersey @Consumes
and @Produces
? I'm confused within Jersey Restful service.
Upvotes: 4
Views: 12612
Reputation: 2114
@Consumes
specifies what MIME type a resource accepts from the client. @Produces
, however, specifies what MIME type a resources gives to the client. For example, a resource might accept application/json
(@Consumes
) and return text/plain
(@Produces
).
https://docs.oracle.com/cd/E19226-01/820-7627/6nisfjmko/index.html
Upvotes: 4