@platform/http
Version:
Tools for working with HTTP.
20 lines (19 loc) • 912 B
TypeScript
import * as t from './types';
export declare function stringify(data: any, errorMessage: () => string): string;
export declare function parseJson(args: {
url: string;
text: string;
}): t.Json;
export declare function toRawHeaders(input?: t.IHttpHeaders): Headers;
export declare function fromRawHeaders(input: Headers): t.IHttpHeaders;
export declare function headerValue(key: string, headers?: t.IHttpHeaders): string;
export declare function isFormData(headers?: t.IHttpHeaders): boolean;
export declare function isStream(value?: ReadableStream<Uint8Array>): boolean;
export declare const response: {
fromPayload(payload: t.IHttpRespondPayload, modifications?: {
data?: any;
headers?: t.IHttpHeaders | undefined;
}): Promise<t.IHttpResponse>;
fromFetch(res: t.IHttpFetchResponse): Promise<t.IHttpResponse>;
toContentType(headers: t.IHttpHeaders): t.IHttpContentType;
};