t-comm
Version:
专业、稳定、纯粹的工具库
40 lines (39 loc) • 1.09 kB
TypeScript
/**
* 获取 Promise 化的 HTTP POST 请求方法
* 将 request.post 方法转换为返回 Promise 的异步函数
* @returns Promise 化的 POST 请求函数
* @example
* ```ts
* const post = nodePost();
* const response = await post({
* url: 'https://api.example.com/data',
* json: { key: 'value' }
* });
* ```
*/
export declare function nodePost(): Function;
/**
* 获取 Promise 化的 HTTP GET 请求方法
* 将 request.get 方法转换为返回 Promise 的异步函数
* @returns Promise 化的 GET 请求函数
* @example
* ```ts
* const get = nodeGet();
* const response = await get('https://api.example.com/data');
* ```
*/
export declare function nodeGet(): Function;
/**
* 获取 Promise 化的 HTTP PUT 请求方法
* 将 request.put 方法转换为返回 Promise 的异步函数
* @returns Promise 化的 PUT 请求函数
* @example
* ```ts
* const put = nodePut();
* const response = await put({
* url: 'https://api.example.com/data/123',
* json: { key: 'updated value' }
* });
* ```
*/
export declare function nodePut(): Function;