Default Headers

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

- {@link oajr.annotation.Rest#reqHeaders() Rest(reqHeaders)}
  Defines default headers on request when the client doesn't specify them.
- {@link oajr.annotation.Rest#resHeaders() Rest(resHeaders)}
  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 reqHeaders={"Accept: text/json"}, // Add a version header attribute to all responses resHeaders={"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#reqHeaders(String[])}
  - {@link oajr.RestContextBuilder#resHeaders(String[])}