-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
request.ts
40 lines (34 loc) 路 1.12 KB
/
request.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// deno-lint-ignore-file
import { ServerRequest } from 'https://deno.land/std@0.106.0/http/server.ts'
import { App } from './app.ts'
import { QueryParams, Ranges, Protocol, AcceptsReturns, Middleware } from './types.ts'
export interface Request<Body = Record<string, unknown>> extends ServerRequest, tinyhttp.Request {
path: string
originalUrl: string
query: QueryParams
app: App
params: Record<string, any>
get: (header: string) => string | string[] | null
xhr: boolean
fresh?: boolean
stale?: boolean
accepts: (...types: string[]) => AcceptsReturns
acceptsEncodings: (...encodings: string[]) => AcceptsReturns
acceptsCharsets: (...charsets: string[]) => AcceptsReturns
acceptsLanguages: (...languages: string[]) => AcceptsReturns
range: (size: number, options?: any) => -1 | -2 | Ranges | undefined
route?: Middleware | undefined
is: (...types: string[]) => string | boolean
hostname: string | undefined
ip?: string
ips?: string[]
protocol?: Protocol
subdomains?: string[]
secure?: boolean
cookies?: any
signedCookies?: any
connection: {
remoteAddress: string
}
parsedBody?: Body
}