Neil
Neil

Reputation: 3056

What's the different between Jersey @Consumes and @Produces

What's the different between Jersey @Consumes and @Produces? I'm confused within Jersey Restful service.

Upvotes: 4

Views: 12612

Answers (1)

Josh Grosso
Josh Grosso

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

Related Questions