The Location header value
The redirect status; 302 by default, matching IResponse.redirect
A standard method decorator
At register(), when status is not a redirect status, when
url is blank or is not a value the runtime accepts as a header, or when
the same handler also carries @HttpCode
Declares that a handler answers with a redirect: the given status and a
Locationheader.It does not short-circuit the handler. A decorator cannot decline to call the method — the plugin invokes it before it can inspect anything it returns — so a
@Redirectthat claimed to skip the body would be describing a path it does not control. The handler still runs and a plain return is still serialised. That is the point of the declarative form: the handler's work is the side effect, and the redirect is a property of the route.A handler that wants to decide per request should call
ctx.response.redirect(url)itself through@Params(Ctx()), which terminates the response and returns aHandlerResult.statusmust be an integer in[300, 399], andurlmust be non-blank and a value the runtime will carry as aLocationheader — both refused atregister()otherwise, for the reason@ResponseHeadervalidates its own pair: an invalid header value throws while the response headers are written, so every request to the route would answer500. A blank target is refused separately, because the runtime ACCEPTS it and serves a redirect no client can follow. The same handler may not also carry@HttpCode— both set the status.