import { HttpClient } from '@angular/common/http'; import { Observable } from 'rxjs/internal/Observable'; import { HttpRequestType, HttpResponse } from './http.model'; export declare class HttpService { private http; constructor(http: HttpClient); /** * 转换不同的请求方式 */ request(type: HttpRequestType, url: string, params?: any, options?: any): Observable; /** * POST请求 */ post(url: string, params?: any, options?: any): Observable; /** * PUT请求 */ put(url: string, params?: any, options?: any): Observable; /** * GET请求 */ get(url: string, params?: any, options?: any): Observable; /** * DELETE请求 */ delete(url: string, params?: any, options?: any): Observable; /** * 处理成功 */ private handleResponseSuccess; /** * 处理失败 */ private handleResponseError; /** * 生成HttpResponse对象 */ private getHttpResponseObj; }