flagpole
Version:
Simple and fast DOM integration, headless or headful browser, and REST API testing framework.
67 lines (66 loc) • 2.47 kB
TypeScript
/// <reference types="node" />
import { KeyValue, BrowserOptions, iHttpRequest, HttpData, HttpAuthType, HttpAuth, HttpTimeout, HttpProxy, HttpMethodVerb, HttpRequestOptions, HttpRequestFetch } from "./interfaces";
import { HttpResponse } from "./httpresponse";
import * as http from "http";
import * as FormData from "form-data";
import { ScenarioType } from "./scenario-types";
export declare const HttpMethodVerbAllowedValues: string[];
export declare class HttpRequest implements iHttpRequest {
private _uri;
private _method;
private _headers;
private _cookies;
private _verifyCert;
private _proxy;
private _timeout;
private _maxRedirects;
private _auth;
private _authType;
private _data;
private _fetched;
private _browser;
private _type;
private _outputFile?;
get uri(): string | null;
set uri(value: string | null);
get method(): HttpMethodVerb;
set method(value: HttpMethodVerb);
get type(): ScenarioType;
set type(value: ScenarioType);
get headers(): KeyValue;
set headers(value: KeyValue);
get cookies(): KeyValue;
set cookies(value: KeyValue);
get auth(): HttpAuth | undefined;
set auth(value: HttpAuth | undefined);
get authType(): HttpAuthType;
set authType(value: HttpAuthType);
get maxRedirects(): number;
set maxRedirects(value: number);
get timeout(): HttpTimeout;
set timeout(value: HttpTimeout);
get proxy(): HttpProxy | undefined;
set proxy(value: HttpProxy | undefined);
get verifyCert(): boolean;
set verifyCert(value: boolean);
get data(): HttpData;
set data(value: HttpData);
get browser(): BrowserOptions;
set browser(value: BrowserOptions);
get proxyAgent(): http.Agent | undefined;
get isImmutable(): boolean;
get outputFile(): string | undefined;
set outputFile(value: string | undefined);
get options(): HttpRequestOptions;
constructor(opts: HttpRequestOptions);
setType(type: ScenarioType): void;
setOptions(opts: HttpRequestOptions): HttpRequest;
setCookie(key: string, value: any): void;
getCookie(key: string): any;
setHeader(key: string, value: any): void;
getHeader(key: string): any;
setJsonData(data: KeyValue): void;
setFormData(formData: FormData): HttpRequest;
setFormData(data: KeyValue, isMultipart?: boolean): HttpRequest;
fetch(opts?: KeyValue, fetchMethod?: HttpRequestFetch): Promise<HttpResponse>;
}