RoutingContext

A new RoutingContext(ctx) instance is created for each HTTP request. <p> You can visit the RoutingContext instance in the whole router chain. It provides HTTP request/response API and allows you to maintain arbitrary data that lives for the lifetime of the context. Contexts are discarded once they have been routed to the handler for the request. <p> The context also provides access to the Session, cookies and body for the request, given the correct handlers in the application.

abstract
class RoutingContext : Closeable {}

Members

Functions

addCookie
RoutingContext addCookie(Cookie cookie)
Undocumented in source. Be warned that the author may not have intended to support it.
enableAsynchronousRead
void enableAsynchronousRead()
Undocumented in source.
end
RoutingContext end(string value)
Undocumented in source. Be warned that the author may not have intended to support it.
end
RoutingContext end()
Undocumented in source.
end
RoutingContext end(byte[] b)
Undocumented in source. Be warned that the author may not have intended to support it.
fail
void fail(Exception ex)
Undocumented in source. Be warned that the author may not have intended to support it.
flush
void flush()
Undocumented in source.
getAndCreateSession
HttpSession getAndCreateSession(int maxAge)
Undocumented in source.
getAttribute
Variant getAttribute(string key)
Undocumented in source.
getAttributeAs
T getAttributeAs(string key)
Undocumented in source. Be warned that the author may not have intended to support it.
getAttributes
Variant[string] getAttributes()
Undocumented in source.
getConnectionId
int getConnectionId()
Undocumented in source.
getContentLength
long getContentLength()
Undocumented in source. Be warned that the author may not have intended to support it.
getCookies
Cookie[] getCookies()
Undocumented in source. Be warned that the author may not have intended to support it.
getFields
HttpFields getFields()
Undocumented in source. Be warned that the author may not have intended to support it.
getHttpVersion
HttpVersion getHttpVersion()
Undocumented in source. Be warned that the author may not have intended to support it.
getMethod
string getMethod()
Undocumented in source. Be warned that the author may not have intended to support it.
getParameter
string getParameter(string name)
Undocumented in source.
getParameterMap
Map!(string, List!string) getParameterMap()
Undocumented in source.
getParameterValues
List!string getParameterValues(string name)
Undocumented in source.
getPathParameter
string getPathParameter(string name)
Undocumented in source. Be warned that the author may not have intended to support it.
getRegexGroup
string getRegexGroup(int index)
Undocumented in source. Be warned that the author may not have intended to support it.
getRequest
HttpServerRequest getRequest()
Undocumented in source.
getRequestedSessionId
string getRequestedSessionId()
Undocumented in source.
getResponse
HttpServerResponse getResponse()
Undocumented in source.
getResponseHeaders
HttpFields getResponseHeaders()
Undocumented in source. Be warned that the author may not have intended to support it.
getRouterParameter
string getRouterParameter(string name)
Undocumented in source.
getSession
HttpSession getSession()
Undocumented in source.
getSession
HttpSession getSession(bool create)
Undocumented in source.
getSessionById
HttpSession getSessionById(string id)
Undocumented in source.
getSessionIdParameterName
string getSessionIdParameterName()
Undocumented in source.
getSessionSize
int getSessionSize()
Undocumented in source.
getStringBody
string getStringBody(string charset)
Undocumented in source.
getStringBody
string getStringBody()
Undocumented in source.
getURI
HttpURI getURI()
Undocumented in source. Be warned that the author may not have intended to support it.
getWildcardMatchedResult
string getWildcardMatchedResult(int index)
Undocumented in source. Be warned that the author may not have intended to support it.
groupName
string groupName()
Undocumented in source.
groupName
void groupName(string name)
Undocumented in source.
hasNext
bool hasNext()

If return false, it represents current handler is the last.

httpConnection
HttpConnection httpConnection()
Undocumented in source.
isAsynchronousRead
bool isAsynchronousRead()

If return true, it represents you has set a HTTP body data receiving callback.

isCommitted
bool isCommitted()
Undocumented in source.
isRequestedSessionIdFromCookie
bool isRequestedSessionIdFromCookie()
Undocumented in source.
isRequestedSessionIdFromURL
bool isRequestedSessionIdFromURL()
Undocumented in source.
next
void next()

Execute the next handler.

outputStream
OutputStream outputStream()
Undocumented in source.
redirect
void redirect(string url)
Undocumented in source. Be warned that the author may not have intended to support it.
removeAttribute
Variant removeAttribute(string key)
Undocumented in source.
removeSession
bool removeSession()
Undocumented in source.
removeSessionById
bool removeSessionById(string id)
Undocumented in source.
response
void response(HttpServerResponse response)
Undocumented in source.
responseHeader
void responseHeader(HttpHeader header, HttpHeaderValue value)
Undocumented in source. Be warned that the author may not have intended to support it.
responseHeader
void responseHeader(string header, string value)
Undocumented in source. Be warned that the author may not have intended to support it.
responseHeader
void responseHeader(HttpHeader header, string value)
Undocumented in source. Be warned that the author may not have intended to support it.
setAttribute
void setAttribute(string key, T value)
Undocumented in source. Be warned that the author may not have intended to support it.
setAttribute
void setAttribute(string key, Variant value)
Undocumented in source.
setHttpVersion
RoutingContext setHttpVersion(HttpVersion httpVersion)
Undocumented in source. Be warned that the author may not have intended to support it.
setReason
RoutingContext setReason(string reason)
Undocumented in source. Be warned that the author may not have intended to support it.
setStatus
RoutingContext setStatus(int status)
Undocumented in source. Be warned that the author may not have intended to support it.
succeed
void succeed(bool t)
Undocumented in source. Be warned that the author may not have intended to support it.
updateSession
bool updateSession(HttpSession httpSession)
Undocumented in source.
write
RoutingContext write(string value)
Undocumented in source.
write
RoutingContext write(byte[] b, int off, int len)
Undocumented in source.
write
RoutingContext write(byte[] b)
Undocumented in source. Be warned that the author may not have intended to support it.

Meta