I am trying to set a header value in a response from a RESTful endpoint using RESTeasy. I know that I can read header parameters using @HeaderParam but I want to change the valu
RESTEasy can inject HttpResponse which enables you to set header parameters.
HttpResponse
@Path("/") public class MyService { @Context org.jboss.resteasy.spi.HttpResponse response; @GET @Path("/") public void setHeader(){ response.getOutputHeaders().putSingle("X-Some-Header", "value"); } }