UNPKG

pluto-http-client

Version:

HTTP client for NodeJS. Inspired in the Java JAX-RS spec so you can expect excellence, versatility and extensibility.

32 lines (31 loc) 1.16 kB
/// <reference types="node" /> /// <reference types="node" /> import { Client } from "./client"; import { Header } from "./header"; import { Filter } from "./filter"; import { MultiValueMap, TreeMultiValueMap } from "../utils/collections"; import { TimeUnit } from "../utils/time-unit"; import http from "http"; import https from "https"; export declare class ClientBuilder { private _timeout?; private _allowInsecure; private _headers; private _filters; private _agent?; private _http2; constructor(); setAllowInsecure(allow: boolean): ClientBuilder; withAgent(agent?: http.Agent | https.Agent): ClientBuilder; withTimeout(timeout: number, timeUnit?: TimeUnit): ClientBuilder; withHeader(name: string, value: string): ClientBuilder; withFilter(filter: Filter): ClientBuilder; withHttp2(): ClientBuilder; get timeout(): number | undefined; get headers(): MultiValueMap<Header>; get filters(): TreeMultiValueMap<number, Filter>; header(key: string, value: string): ClientBuilder; get allowInsecure(): boolean; get agent(): http.Agent | https.Agent | undefined; build(): Client; }