@coolio/http
Version:
HTTP networking client
18 lines • 743 B
TypeScript
export declare enum ContentType {
BINARY = "application/octet-stream",
JSON = "application/json",
MULTIPART_FORM = "multipart/form-data",
TEXT = "text/plain",
URL_ENCODED = "application/x-www-form-urlencoded",
VND_JSON = "application/vnd.api+json"
}
export declare const ContentTypeRegex: {
JSON: RegExp;
MULTIPART: RegExp;
TEXT: RegExp;
URL_ENCODED: RegExp;
};
export declare type ContentTypeMap<T> = Record<keyof typeof ContentTypeRegex, T>;
export declare function switchContentType<T>(contentType: string, map: ContentTypeMap<T>, defaultResult: T): T;
export declare function switchContentType<T>(contentType: string, map: ContentTypeMap<T>): T | undefined;
//# sourceMappingURL=contentType.d.ts.map