November 2017
Intermediate to advanced
420 pages
10h 29m
English
The @javax.ws.rs.Consumes annotation defines the internet media type(s) that the resource class methods can accept. You can define the @Consumes annotation either at the class level (which will get defaulted for all methods) or at the method level. The method-level annotations override the class-level annotations. The possible internet media types that a REST API can consume are as follows:
The following example illustrates how you can use the @Consumes attribute to designate a method in a class to consume a payload presented ...