///
///
///
///
///
import FormData from "form-data";
import { URLSearchParams } from 'url';
import * as http from 'http';
import * as https from 'https';
import { Readable } from 'node:stream';
import { Observable } from '../rxjsStub.js';
import { Configuration } from '../configuration.js';
export * from './isomorphic-fetch.js';
export declare enum HttpMethod {
GET = "GET",
HEAD = "HEAD",
POST = "POST",
PUT = "PUT",
DELETE = "DELETE",
CONNECT = "CONNECT",
OPTIONS = "OPTIONS",
TRACE = "TRACE",
PATCH = "PATCH"
}
export type HttpFile = {
data: Buffer;
name: string;
};
export declare class HttpException extends Error {
constructor(msg: string);
}
export type RequestBody = undefined | string | FormData | URLSearchParams;
export declare class RequestContext {
private httpMethod;
private headers;
private body;
private url;
private agent;
constructor(url: string, httpMethod: HttpMethod, configuration: Configuration);
getUrl(): string;
setUrl(url: string): void;
setBody(body: RequestBody): void;
getHttpMethod(): HttpMethod;
getHeaders(): {
[key: string]: string;
};
getBody(): RequestBody;
setQueryParam(name: string, value: string): void;
addCookie(name: string, value: string): void;
setHeaderParam(key: string, value: string): void;
setAgent(agent: http.Agent | https.Agent): void;
getAgent(): http.Agent | https.Agent | undefined;
}
export interface ResponseBody {
text(): Promise;
binary(): Promise;
stream(): Readable;
}
export declare class SelfDecodingBody implements Omit {
private dataSource;
constructor(dataSource: Promise);
binary(): Promise;
text(): Promise;
}
export declare class ResponseContext {
httpStatusCode: number;
headers: {
[key: string]: string;
};
body: ResponseBody;
constructor(httpStatusCode: number, headers: {
[key: string]: string;
}, body: ResponseBody);
getParsedHeader(headerName: string): {
[parameter: string]: string;
};
getBodyAsFile(): Promise;
getBodyAsAny(): Promise;
}
export interface HttpLibrary {
send(request: RequestContext): Observable;
}
export interface PromiseHttpLibrary {
send(request: RequestContext): Promise;
}
export declare function wrapHttpLibrary(promiseHttpLibrary: PromiseHttpLibrary): HttpLibrary;