0

I have rest from Spring Boot v. 4.1 and want to compress the response with gzip for example. Could you help me please?

The code looks like:

@RestController
@RequestMapping("/api/")

@RequestMapping(value = "/id/{id}", method = RequestMethod.GET)

I tried to add “produces” parameter into @RequestMapping but does not know which value format is correct for that. Is it possible to compress response by this way?

produces = {APPLICATION_XML_VALUE} 
Vadim
  • 753
  • 8
  • 22
  • Does this answer your question? [Using GZIP compression with Spring Boot/MVC/JavaConfig with RESTful](https://stackoverflow.com/questions/21410317/using-gzip-compression-with-spring-boot-mvc-javaconfig-with-restful) – Lino Mar 15 '21 at 08:05
  • @Lino Thank u. I want to make compression in code, for different application servers and for a few methods, not for all. – Vadim Mar 15 '21 at 08:33
  • How about this one? [How to Compress Responses in Java REST API with GZip and Jersey](https://dzone.com/articles/how-compress-responses-java) – LHCHIN Mar 15 '21 at 09:34

0 Answers0