flagpole
Version:
Simple and fast DOM integration, headless or headful browser, and REST API testing framework.
33 lines (32 loc) • 1.22 kB
TypeScript
import * as puppeteer from "puppeteer-core";
import { NeedleResponse } from "needle";
import { KeyValue, HttpResponseOptions, iHttpRequest } from "./interfaces";
import { FfprobeData } from "media-probe";
import { probeImageResponse } from "./adapters/image";
export interface ffprobeResponse {
headers: KeyValue;
statusCode: number;
url: string;
length: number;
probeData: FfprobeData;
}
export declare class HttpResponse {
body: string;
json: any;
statusCode: number;
statusMessage: string;
headers: KeyValue;
cookies: KeyValue;
trailers: KeyValue;
url: string;
method: string;
private constructor();
static createEmpty(): HttpResponse;
static fromNeedle(response: NeedleResponse): HttpResponse;
static fromPuppeteer(response: puppeteer.Response, body: string, cookies?: KeyValue): HttpResponse;
static fromJsonData(request: iHttpRequest, data: any): HttpResponse;
static fromProbeImage(response: probeImageResponse, cookies?: KeyValue): HttpResponse;
static fromLocalFile(relativePath: string): Promise<HttpResponse>;
static fromString(content: string): HttpResponse;
static fromOpts(opts: HttpResponseOptions): HttpResponse;
}