Goodmorning Marc,
When you create an instance of a ResponseBuilder you can add headers to it. However make sure that you return the Response and not the ResponseBuilder. You can do that by calling the build() method of the ResponseBuilder like the last line below.
jakarta.ws.rs.core.Response.ResponseBuilder respBuilder = Response.status(200);
respBuilder = respBuilder.header("MyHeader", "MyHeaderValue");
respBuilder = respBuilder.entity("Happy new year");
return respBuilder.build();
Hope this is what you are looking for.
Thanks @Gert.K , I’ll give this a try!