In my application based on API REST, I need to return for all results of all requestes, a custom field in the Response Headers. Now I use this approach:
response().setHeader("custom-field",valuateSender());
return ok(response.addData(body));
In this way, however, I am forced to call the result () method in all my actions, I’m looking for a more general and more intelligent approach.