pluto-http-client
Version:
HTTP client for NodeJS. Inspired in the Java JAX-RS spec so you can expect excellence, versatility and extensibility.
53 lines (52 loc) • 1.78 kB
TypeScript
/// <reference types="node" />
/// <reference types="node" />
import { MediaType } from "./media-type";
import { Writable } from "stream";
import { MultiValueMap } from "../utils/collections";
import { Cookie } from "./cookie";
import { Unmarshal } from "../framework/unmarshal";
import { MultiValueMapType } from "./header";
import { EntityTag } from "./entity-tag";
import ReadableStream = NodeJS.ReadableStream;
export declare class Family {
private static readonly INFORMATIONAL;
private static readonly SUCCESSFUL;
private static readonly REDIRECTION;
private static readonly CLIENT_ERROR;
private static readonly SERVER_ERROR;
private static readonly OTHER;
private readonly _familyNumber;
private constructor();
isInformal(): boolean;
isSuccessful(): boolean;
isRedirection(): boolean;
isClientError(): boolean;
isServerError(): boolean;
isOther(): boolean;
static familyOf(statusCode: number): Family;
}
export declare class StatusType {
private _statusCode;
constructor(_statusCode: number);
getStatusCode(): number;
getFamily(): Family;
}
export interface Response {
getHeaders(): MultiValueMapType;
getStatusInfo(): StatusType;
getStatus(): number;
getMediaType(): MediaType | undefined;
getEtag(): EntityTag | undefined;
getDate(): Date | undefined;
getLastModified(): Date | undefined;
getHeaderString(key: string): string;
getCookies(): MultiValueMap<Cookie>;
readEntity<T>(unmarshaller: Unmarshal<T>): Promise<T>;
readEntity(writable: Writable): Writable;
close(): void;
}
export interface ResponseContextStreaming {
pipe(readable: ReadableStream): void;
}
export interface ResponseContext extends Response, ResponseContextStreaming {
}