/// import { ServerRequest } from "http"; import { Url } from "url"; import { Headers } from "./define"; import { Context } from "./context"; export declare class Request { readonly req: ServerRequest; readonly ctx: Context; /** 已解析的URL信息 */ protected parsedUrlInfo: Url; constructor(req: ServerRequest, ctx: Context); /** * 初始化完成 */ inited(): void; /** 获取请求方法 */ readonly method: string; /** 获取URL */ /** 更新URL */ url: string; /** 获取Path(URL不包含查询字符串部分)*/ /** 设置Path(URL不包含查询字符串部分)*/ path: string; /** 获取URL查询字符串部分 */ readonly search: string; /** 获取已解析的URL查询字符串参数 */ readonly query: Record; /** 获取当前HTTP版本 */ readonly httpVersion: string; /** 获取所有请求头 */ readonly headers: Headers; /** * 获取请求头 * * @param name 名称 */ getHeader(name: string): string | string[]; /** 获取URL参数 */ /** 设置URL参数 */ params: Record; /** 判断是否有URL参数 */ hasParams(): boolean; /** 获取请求Body参数 */ /** 设置请求Body参数 */ body: Record; /** 判断是否有请求Body参数 */ hasBody(): boolean; /** 获取请求文件参数 */ /** 设置请求文件参数 */ files: Record; /** 判断是否有请求文件参数 */ hasFiles(): boolean; /** 获取请求Cookies信息 */ /** 设置请求Cookies信息 */ cookies: Record; /** 判断是否有请求Cookie信息 */ hasCookies(): boolean; /** 获取请求signedCookies信息 */ /** 设置请求signedCookies信息 */ signedCookies: Record; /** 判断是否有请求signedCookies信息 */ hasSignedCookies(): boolean; /** 获取请求Session信息 */ /** 设置请求Session信息 */ session: Record; /** 判断是否有请求Session信息 */ hasSession(): boolean; }