0

I am using rest easy in my java application.
My end goal is that if for any request the content-type is of type zip, for example application/x-gzip, then the response should be zipped.

I read in the rest easy document that we can do this by using the GZIP annotation. Rest easy will take care of it.

But the problem is, I have quite a lot web api calls, therefore adding this annotation in all the methods is not the right solution.

I am looking for a solution in such a way, where i define this annotation at one place instead of adding the annotation(GZIP) on every method, and if the user has specified the content type to be of zip, then the response is zipped and sent to the user. Something like a filter or something.

For this i was able to find something known as DynamicFeature in the documentation but do not know how to achieve this or implement this.

Can anyone suggest how to achieve this or some other way if exists.

Loui
  • 533
  • 17
  • 33

0 Answers0