@amadeus-it-group/kassette
Version:
Development server, used mainly for testing, which proxies requests and is able to easily manage local mocks.
26 lines (25 loc) • 954 B
TypeScript
import { IncomingMessage, IncomingHttpHeaders } from 'http';
import { URL } from 'url';
import { IFetchedRequest } from './model';
import { Http2ServerRequest } from 'http2';
/**
* Implementation of the wrapper around a fetched request.
*
* @param original The original request object
* @param body The body of the request
*/
export declare class Request implements IFetchedRequest {
readonly original: IncomingMessage | Http2ServerRequest;
readonly body: Buffer;
constructor(original: IncomingMessage | Http2ServerRequest, body: Buffer);
get connectionsStack(): readonly Readonly<import("./model").Connection>[];
get connection(): Readonly<import("./model").Connection>;
get method(): string;
get headers(): IncomingHttpHeaders;
get url(): URL;
get queryParameters(): Readonly<Record<string, string>>;
get pathname(): string;
get protocol(): string;
get hostname(): string;
get port(): string;
}