UNPKG

web-dev-server

Version:

Node.js simple http server for common development or training purposes.

33 lines (32 loc) 1.21 kB
import { Request } from "../Request"; import { Response } from '../Response'; export declare class Params { protected params?: any; protected body?: string; protected response?: Response; IsCompleted(): boolean; GetBody(): Promise<string>; SetParams(params: any): Request; GetParams(nameReplaceFilter?: string | false | { pattern: string | RegExp; replace: string | Function; }, valueReplaceFilter?: string | false | { pattern: string | RegExp; replace: string | Function; }, onlyNames?: string[]): any; SetParam(name: string, value: any): Request; GetParam(name: string, valueReplaceFilter?: string | false | { pattern: string | RegExp; replace: string | Function; }, ifNullValue?: any): any; RemoveParam(name: string): Request; HasParam(name: string): boolean; /** * Initialize params from GET (or also from post, if request is already completed). */ protected initParams(): void; /** * @summary Read and return unserialized POST/PUT request body by "content-type" header. */ protected parseBodyParams(contentType: string): any; }