@Consumes and @Produces Code -21 | Consumes in Spring Boot| Produces in Web Services/Spring

Опубликовано: 01 Март 2026
на канале: AnilKumar TechWorld
150
0

@Consumes and @Produces Code -21 | Consumes in Spring Boot| Produces in Web Services/Spring
JAX-RS @Produces annotation is used to specify the MIME media type ( output ) that a resource method can produce and send it back to the client.
@Produces annotation can be applied at both class level and method level. If it is applied at the class level, all the methods in a resource will produce the specified MIME type by default and if it is applied at the method level, then annotated method will produce the specified MIME type by overriding any @Produces annotations applied at the class level.