Default Headers

The following annotations are provided for specifying default header values for requests and responses:

- {@link oajr.annotation.Rest#defaultRequestHeaders() Rest(defaultRequestHeaders)}
  Defines default headers on request when the client doesn't specify them.
- {@link oajr.annotation.Rest#defaultResponseHeaders() Rest(defaultResponseHeaders)}
  Appends the specified headers if they weren't already set programmatically.

##### Example:

// Servlet with default headers @Rest( // Assume "text/json" Accept value when Accept not specified defaultRequestHeaders={"Accept: text/json"}, // Add a version header attribute to all responses defaultResponseHeaders={"X-Version: 1.0"} ) public MyRestServlet extends BasicRestServlet { ... }

Default headers can also be specified programmatically by overriding the following methods:

- {@link oajr.RestContextBuilder}
  - {@link oajr.RestContextBuilder#defaultRequestHeaders(String[])}
  - {@link oajr.RestContextBuilder#defaultResponseHeaders(String[])}