Skip to content

Controller

Olaf Erlandsen edited this page Aug 3, 2018 · 2 revisions

Reserved Methods & Properties

Request

request.hasIn

if (this.request.hasIn('content-type', 'header') {
    // ...
}

request.getIn

const contentType = this.request.getIn('content-type', 'header');

request.setIn

this.request.setIn('content-type', 'header', 'application/json; charset=utf8');

request.bodyAsJson

this.request.bodyAsJson();

Response

response.ok

this.response.ok();

response.badRequest

this.response.badRequest();

response.internalServerError

this.response.internalServerError();

response.noContent

this.response.noContent();

response.accepted

this.response.accepted();

response.notFound

this.response.notFound();

response.unauthorized

this.response.unauthorized();

response.forbidden

this.response.forbidden();

response.methodNotAllowed

this.response.methodNotAllowed();

response.redirect

this.response.redirect();