UNPKG

camstreamerlib

Version:

Helper library for CamStreamer ACAP applications.

30 lines (29 loc) 876 B
/// <reference types="node" /> /// <reference types="node" /> import { FormData as UndiciFormData, Response as UndiciResponse } from 'undici'; export type HttpRequestOptions = { method?: string; protocol: string; host: string; port: number; path: string; user?: string; pass?: string; timeout?: number; headers?: Record<string, string>; }; export type AgentOptions = { rejectUnaurhorized?: boolean; keepAlive?: boolean; }; export declare class HttpRequestSender { private agent?; private authData?; constructor(agentOptions?: AgentOptions); sendRequest(options: HttpRequestOptions, postData?: Buffer | string | UndiciFormData): Promise<UndiciResponse>; private sendRequestWithAuth; private static getURL; private getAuthorization; private invalidateAuthorization; private static getAuthHeader; }