public interface GroovyContext extends Context
Context
that adds Groovy friendly variants of methods.Modifier and Type | Method and Description |
---|---|
void |
byContent(Closure<?> closure)
Responds based on the client's preferred response content type (i.e.
|
void |
byMethod(Closure<?> closure)
Responds based on HTTP method.
|
GroovyContext |
getContext()
Returns this.
|
void |
onClose(Closure<?> closure)
Adds a request close handler.
|
addExecInterceptor, all, blocking, clientError, each, error, file, first, get, get, getAll, getAll, getAllPathTokens, getBindAddress, getByContent, getByMethod, getDirectChannelAccess, getExecution, getLaunchConfig, getPathTokens, getRequest, getResponse, insert, insert, lastModified, maybeGet, maybeGet, next, next, onClose, parse, parse, parse, parse, parse, promise, redirect, redirect, render, respond
GroovyContext getContext()
getContext
in interface Context
void byMethod(@DelegatesTo(value=GroovyByMethodHandler.class) Closure<?> closure)
closure
- defines the action to take for different HTTP methodsvoid byContent(@DelegatesTo(value=GroovyByContentHandler.class) Closure<?> closure)
closure
- defines the action to take for the different content typesvoid onClose(@DelegatesTo(value=RequestOutcome.class,strategy=1) Closure<?> closure)
closure
- A closure to call when the request is closed