Skip to Content
Building RESTful Web Services with Java EE 8
book

Building RESTful Web Services with Java EE 8

by Mario-Leander Reimer
July 2018
Intermediate to advanced
116 pages
2h 41m
English
Packt Publishing
Content preview from Building RESTful Web Services with Java EE 8

Introduction to content types and content negotiation

In this section, we're going to take a look at using the @Produces and @Consumes annotations to specify the content types. We'll also learn about API versioning using custom content types, smart content negotiation using a quality from server factor, and how you can serve and upload binary content.

Let's switch to code and open our IDE. Let's take a look at the small REST service that we have prepared. As you already know, you can specify the @Produces or @Consumes annotations to specify what your REST service will consume as a content type and what content type your REST service will produce. What we do here is we specify application/json. This is what we usually do. We implement this ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

RESTful Java Web Services - Third Edition

RESTful Java Web Services - Third Edition

Balachandar Bogunuva Mohanram

Publisher Resources

ISBN: 9781789532883Supplemental Content