Skip to Content
RESTful Java Web Services - Third Edition
book

RESTful Java Web Services - Third Edition

by Balachandar Bogunuva Mohanram
November 2017
Intermediate to advanced
420 pages
10h 29m
English
Packt Publishing
Content preview from RESTful Java Web Services - Third Edition

GZIP compression/decompression

With a lot of mobile applications being used in the market, it becomes essential to enable faster transmission of large chunks of data over a network. RESTEasy provides the GZIP compression/decompression feature. When the response body is plain text, it can be easily compressed on the server side and then decompressed on the client side. RESTEasy accomplishes this with the @GZIP annotation applied at the method level, as shown ahead:

 /** * Returns list of departments * */ @GET @Produces(MediaType.APPLICATION_JSON) @GZIP public List<Departments> findAllDepartments() { //Find all departments from the data store and return compressed response javax.persistence.criteria.CriteriaQuery cq = entityManager.getCriteriaBuilder().createQuery(); ...
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, Second Edition

RESTful Java Web Services, Second Edition

Jobinesh Purushothaman
Java Web Services

Java Web Services

David A Chappell, Tyler Jewell

Publisher Resources

ISBN: 9781788294041Supplemental Content