UNPKG

770 BTypeScriptView Raw
1declare type RequestType = 'xml' | 'json' | 'text' | 'plain' | 'formdata' | undefined;
2declare type ResponseType = 'text' | 'json' | 'buffer' | undefined;
3interface ifRequestOption {
4 request_type?: RequestType;
5 respon_type?: ResponseType;
6 respon_head?: boolean;
7 ca_name?: string;
8}
9export declare function loadCert(name: string, cert_path: string, key_path: string, passphrase: string): boolean;
10/**
11 * 异步流程执行网络请求
12 * @param type
13 * @param url
14 * @param data
15 * @param retry
16 * @param headers
17 * @param dtype
18 * @param rtype
19 */
20export declare function http_quest<T>(type: 'get' | 'post' | string, url: string, data?: any, retry?: number, headers?: any, _option?: ifRequestOption | string): Promise<T>;
21export {};