RestRequest

The {@link oajr.RestRequest} object is an extension of the HttpServletRequest class with various built-in convenience methods for use in building REST interfaces. It can be accessed by passing it as a parameter on your REST Java method:

@RestMethod(...) public Object myMethod(RestRequest req) {...}

There are many useful methods on this object, but the main ones are shown below:

- {@link oajr.RestRequest} extends HttpServletRequest
  - {@link oajr.RestRequest#getHeaders() getHeaders()} - HTTP request headers.
  - {@link oajr.RestRequest#getQuery() getQuery()} - Query parameters.
  - {@link oajr.RestRequest#getFormData() getFormData()} - Form-data parameters.
  - {@link oajr.RestRequest#getBody() getBody()} - HTTP request body.
  - {@link oajr.RestRequest#getPathMatch() getPathMatch()} - Path match variables.
  - {@link oajr.RestRequest#getLogger() getLogger()} - Logging.
  - {@link oajr.RestRequest#getInfoProvider() getInfoProvider()} - Swagger documentation provider.
  - {@link oajr.RestRequest#getSwagger() getSwagger()} - Generated Swagger information.
  - {@link oajr.RestRequest#getConfig() getConfig()} - External configuration API.
  - {@link oajr.RestRequest#getVarResolverSession() getVarResolverSession()} - String variable resolver.
  - {@link oajr.RestRequest#getMessageBundle() getMessageBundle()} - Localized messages.
  - {@link oajr.RestRequest#getProperties() getProperties()} - Configuration properties.
  - {@link oajr.RestRequest#getClasspathReaderResource(String,boolean,MediaType,boolean) getClasspathReaderResource(String,boolean,MediaType,boolean)} - Various methods for retrieving static files from classpath.