UNPKG

@jiaxinjiang/nest-http

Version:

Http request component for NestJs.

17 lines (16 loc) 893 B
import { AxiosRequestConfig } from 'axios'; import { HttpService } from '@nestjs/common'; import { RequestConfig, ResponseSchema } from './http.interface'; export declare class HttpFetchService { private httpService; private httpOption; private logger; constructor(httpService: HttpService, httpOption: RequestConfig); private request; post<T = any>(url: string, config?: AxiosRequestConfig): Promise<ResponseSchema<T>>; get<T = any>(url: string, config?: AxiosRequestConfig): Promise<ResponseSchema<T>>; put<T = any>(url: string, config?: AxiosRequestConfig): Promise<ResponseSchema<T>>; delete<T = any>(url: string, config?: AxiosRequestConfig): Promise<ResponseSchema<T>>; patch<T = any>(url: string, config?: AxiosRequestConfig): Promise<ResponseSchema<T>>; head<T = any>(url: string, config?: AxiosRequestConfig): Promise<ResponseSchema<T>>; }