import { Method } from '../types/index'; /** * * * @export * @param {*} headers * @param {*} data * @returns {*} * @description 为 header 设置 content-type 头 */ export declare function handleHeaders(headers: any, data: any): any; /** * * * @export * @param {string} headers * @returns {*} * @description * 将 header 属性中的字符串 * 'date: Fri, 05 Apr 2019 12:40:49 GMT * etag: W/"d-Ssxx4FRxEutDLwo2+xkkxKc4y0k" * 转变成 * { * date: Fri, 05 Apr 2019 12:40:49 GMT * etag: W/"d-Ssxx4FRxEutDLwo2+xkkxKc4y0k" * } * 对象 */ export declare function parseHeaders(headers: string): any; /** * * * @export * @param {*} headers * @param {Method} method * @returns {*} * @description * 主要将 * headers: { * common: { * Accept: 'application/json, text/plain' * }, * post: { * 'Content-Type':'application/x-www-form-urlencoded' * } * } * flatten 成一层 * headers: { * Accept: 'application/json, text/plain' * 'Content-Type':'application/x-www-form-urlencoded' * } * common 中定义的 header 字段都要做提取值 * 对于 post 之类的需要对请求的方法做判断提取值 */ export declare function flattenHeaders(headers: any, method: Method): any;