Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

jersey

jax-rs

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

like image 563
Neil Avatar asked Oct 27 '25 03:10

Neil


1 Answers

@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

like image 106
Joshua Grosso Reinstate CMs Avatar answered Oct 29 '25 09:10

Joshua Grosso Reinstate CMs