Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/xserver/src/mod.ts>Context

X-Server a Deno server module with middleware
Go to Latest
class Context
Re-export
import { Context } from "https://deno.land/x/xserver@5.3.2/src/mod.ts";

Constructors

new
Context(request: Request)

Properties

codes
headers: Headers
readonly
method: Method
redirect
readonly
request: Request
tool: Record<string, any>
readonly
url: URL

Methods

accepted(body?: Body, head?: Head): Promise<Response>
alreadyReported(body?: Body, head?: Head): Promise<Response>
badGateway(body?: Body, head?: Head): Promise<Response>
badRequest(body?: Body, head?: Head): Promise<Response>
body(body: Body): this
code(code: StatusCode): this
conflict(body?: Body, head?: Head): Promise<Response>
continue(body?: Body, head?: Head): Promise<Response>
created(body?: Body, head?: Head): Promise<Response>
earlyHints(body?: Body, head?: Head): Promise<Response>
end(
code?: StatusCode,
body?: Body,
head?: Head,
): Promise<Response>
expectationFailed(body?: Body, head?: Head): Promise<Response>
failedDependency(body?: Body, head?: Head): Promise<Response>
forbidden(body?: Body, head?: Head): Promise<Response>
found(body?: Body, head?: Head): Promise<Response>
gatewayTimeout(body?: Body, head?: Head): Promise<Response>
get(name: string): Record<string, any>
gone(body?: Body, head?: Head): Promise<Response>
head(head: Head): this
html(strings: TemplateStringsArray, ...variables: unknown[]): Promise<Response>
httpVersionNotSupported(body?: Body, head?: Head): Promise<Response>
imUsed(body?: Body, head?: Head): Promise<Response>
insufficientStorage(body?: Body, head?: Head): Promise<Response>
internalServerError(body?: Body, head?: Head): Promise<Response>
lengthRequired(body?: Body, head?: Head): Promise<Response>
locked(body?: Body, head?: Head): Promise<Response>
loopDetected(body?: Body, head?: Head): Promise<Response>
message(message: string): this
methodNotAllowed(body?: Body, head?: Head): Promise<Response>
misdirectedRequest(body?: Body, head?: Head): Promise<Response>
movedPermanently(body?: Body, head?: Head): Promise<Response>
multipleChoices(body?: Body, head?: Head): Promise<Response>
multiStatus(body?: Body, head?: Head): Promise<Response>
networkAuthenticationRequired(body?: Body, head?: Head): Promise<Response>
noContent(body?: Body, head?: Head): Promise<Response>
nonAuthoritativeInfo(body?: Body, head?: Head): Promise<Response>
notAcceptable(body?: Body, head?: Head): Promise<Response>
notExtended(body?: Body, head?: Head): Promise<Response>
notFound(body?: Body, head?: Head): Promise<Response>
notImplemented(body?: Body, head?: Head): Promise<Response>
notModified(body?: Body, head?: Head): Promise<Response>
ok(body?: Body, head?: Head): Promise<Response>
partialContent(body?: Body, head?: Head): Promise<Response>
paymentRequired(body?: Body, head?: Head): Promise<Response>
permanentRedirect(body?: Body, head?: Head): Promise<Response>
preconditionFailed(body?: Body, head?: Head): Promise<Response>
preconditionRequired(body?: Body, head?: Head): Promise<Response>
processing(body?: Body, head?: Head): Promise<Response>
proxyAuthRequired(body?: Body, head?: Head): Promise<Response>
requestedRangeNotSatisfiable(body?: Body, head?: Head): Promise<Response>
requestEntityTooLarge(body?: Body, head?: Head): Promise<Response>
requestHeaderFieldsTooLarge(body?: Body, head?: Head): Promise<Response>
requestTimeout(body?: Body, head?: Head): Promise<Response>
requestURITooLong(body?: Body, head?: Head): Promise<Response>
resetContent(body?: Body, head?: Head): Promise<Response>
seeOther(body?: Body, head?: Head): Promise<Response>
serviceUnavailable(body?: Body, head?: Head): Promise<Response>
set(name: string, value: unknown): void
switchingProtocols(body?: Body, head?: Head): Promise<Response>
teapot(body?: Body, head?: Head): Promise<Response>
temporaryRedirect(body?: Body, head?: Head): Promise<Response>
tooEarly(body?: Body, head?: Head): Promise<Response>
tooManyRequests(body?: Body, head?: Head): Promise<Response>
unauthorized(body?: Body, head?: Head): Promise<Response>
unavailableForLegalReasons(body?: Body, head?: Head): Promise<Response>
unprocessableEntity(body?: Body, head?: Head): Promise<Response>
unsupportedMediaType(body?: Body, head?: Head): Promise<Response>
upgradeRequired(body?: Body, head?: Head): Promise<Response>
useProxy(body?: Body, head?: Head): Promise<Response>
variantAlsoNegotiates(body?: Body, head?: Head): Promise<Response>