Invoke the block.
Invoke the block. This is the main method that an ActionBuilder has to implement, at this stage it can wrap it in any other actions, modify the request object or potentially use a different class to represent the request.
The request
The block of code to invoke
A future of the result
Compose this ActionFunction with another, with this one applied first.
Compose this ActionFunction with another, with this one applied first.
ActionFunction with which to compose
The new ActionFunction
Constructs an Action
with default content, and no request parameter.
Constructs an Action
with default content, and no request parameter.
For example:
val hello = Action { Ok("Hello!") }
the action code
an action
Constructs an Action
with default content.
Constructs an Action
with default content.
For example:
val echo = Action { request => Ok("Got request [" + request + "]") }
the action code
an action
Constructs an Action
.
Constructs an Action
.
For example:
val echo = Action(parse.anyContent) { request => Ok("Got request [" + request + "]") }
the type of the request body
the BodyParser
to use to parse the request body
the action code
an action
Constructs an Action
that returns a future of a result, with default content.
Constructs an Action
that returns a future of a result, with default content.
For example:
val hello = Action.async { request => WS.url(request.getQueryString("url").get).get().map { r => if (r.status == 200) Ok("The website is up") else NotFound("The website is down") } }
the action code
an action
Constructs an Action
that returns a future of a result, with default content.
Constructs an Action
that returns a future of a result, with default content.
For example:
val hello = Action.async { request => WS.url(request.getQueryString("url").get).get().map { r => if (r.status == 200) Ok("The website is up") else NotFound("The website is down") } }
the action code
an action
Constructs an Action
that returns a future of a result, with default content, and no request parameter.
Constructs an Action
that returns a future of a result, with default content, and no request parameter.
For example:
val hello = Action.async { WS.url("http://www.playframework.com").get().map { r => if (r.status == 200) Ok("The website is up") else NotFound("The website is down") } }
the action code
an action
Compose another ActionFunction with this one, with this one applied last.
Compose another ActionFunction with this one, with this one applied last.
ActionFunction with which to compose
The new ActionFunction
Compose the action with other actions.
Compose the action with other actions. This allows mixing in of various actions together.
The action to compose
The composed action
Compose the parser.
Compose the parser. This allows the action builder to potentially intercept requests before they are parsed.
The body parser to compose
The composed body parser
Get the execution context to run the request in.
Get the execution context to run the request in. Override this if you want a custom execution context
The execution context
Provides helpers for creating
Action
values.