UNPKG

pluto-http-client

Version:

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

34 lines (33 loc) 1.15 kB
/// <reference types="node" /> /// <reference types="node" /> import { MediaType } from "./media-type"; import { Encoding } from "./encoding"; import { CacheControl } from "./cache-control"; import { Cookie } from "./cookie"; import { RequestBuilder } from "./request-builder"; import { Transform } from "stream"; import { URL } from "url"; import { Method } from "./method"; import { MultiValueMapType } from "./header"; export interface RequestContextStreaming { transform(transform: Transform): void; } export interface RequestInformation { getHeaders(): MultiValueMapType; getUrl(): URL; getMethod(): Method; } export declare class RequestContext { private readonly _req; constructor(req: RequestBuilder & RequestContextStreaming & RequestInformation); accept(mediaType: MediaType): void; acceptLanguage(locale: string): void; acceptEncoding(encoding: Encoding): void; cacheControl(cacheControl: CacheControl): void; cookie(cookie: Cookie): void; header(key: string, value: string): void; url(): URL; method(): Method; headers(): MultiValueMapType; pipe(transform: Transform): void; }