Skip to main content
Module

x/tinyhttp/request.ts

🦕 Deno port of tinyhttp, 0-legacy, tiny & fast web framework
Latest
File
// deno-lint-ignore-fileimport { 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}