/*! *****************************************************************************
Copyright (c) JDJR Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
Author: kemao 2018-11-29 18:28:33
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
///
import * as HTTP from "http";
export declare class HttpClient {
static topic: string;
static download(url: string, filename: string, headers?: any): Promise;
static getFileSHA1ByURL(url: string, headers?: any): Promise<{
sha1: any;
buffer: any;
} | {
sha1: any;
buffer?: undefined;
}>;
static getJSON(url: string, headers?: any): Promise;
/**
* 增加编码转换功能,以便支持非utf8的内容的获取
*/
static getText(url: string, headers?: any): Promise;
static get(url: any, headers?: any): any;
static getResponse(url: string, headers: any, ungzip?: boolean): Promise<{
statusCode: number;
headers: HTTP.IncomingHttpHeaders;
body: Buffer;
}>;
static getProcessRate(length: number, total: number): string;
static post(url: string, data: Buffer, headers?: any): Promise;
/**
* 推送buffer
* @param url
* @param data Buffer|FormData|JSON
* @param headers
*/
static getPostData(url: string, data: Buffer, headers?: any): Promise;
hostname: string;
cookies: string;
}