Annotations for specifying request-response media types

The Content-Type header field in HTTP describes the body's content type present in the request and response messages. The content types are represented using standard internet media types. A RESTful web service makes use of this header field to indicate the type of content in the request or response message body. We discussed the Content-Type header fields in the Representing content types using HTTP header fields section in Chapter 1, Introducing the REST Architectural Style.

JAX-RS allows you to specify which internet media types of representation a resource can produce or consume by using the @javax.ws.rs.Produces and @javax.ws.rs.Consumes annotations, respectively. You will learn these two annotations with examples in this section.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.216.151.164