import { Request } from "https://deno.land/x/deno_koa@v1.0.4/request.ts";
Constructors
Properties
readonly
cookies: CookiesReturn request's remote address
When app.proxy
is true
, parse
the "X-Forwarded-For" ip address list and return the first one
When app.proxy
is true
, parse
the "X-Forwarded-For" ip address list.
For example if the value were "client, proxy1, proxy2"
you would receive the array ["client", "proxy1", "proxy2"]
where "proxy2" is the furthest down-stream.
req: ServerRequest
Methods
accepts(...types: string[]):
| string
| string[]
| undefined
| boolean
acceptsCharsets(...types: string[]):
| string
| string[]
| undefined
| boolean
acceptsEncodings(...types: string[]):
| string
| string[]
| undefined
| boolean
acceptsLanguages(...types: string[]):
| string
| string[]
| undefined
| boolean
get(field: string): string
Return request header. If the header is not set, will return an empty string.
The Referrer
header field is special-cased, both Referrer
and
Referer
are interchangeable.
Examples:
this.get('Content-Type');
// => "text/plain"
this.get('content-type');
// => "text/plain"
this.get('Something');
// => ''
is(types: string | string[]): string | boolean | null
Check whether the response is one of the listed types.
xhr(): Boolean