UNPKG

@ribajs/core

Version:

Core module of Riba.js

20 lines (19 loc) 1.35 kB
import { HttpMethod } from "../types/http-method.js"; import { HttpServiceOptions, HttpServiceResponse } from "../types/index.js"; export declare class HttpService { static setRequestHeaderEachRequest(name: string, value: string): void; static getJSON<T = any>(url: string, data?: any, headers?: any, options?: HttpServiceOptions): Promise<HttpServiceResponse<T>>; static post<T = any>(url: string, data?: any, dataType?: string, headers?: any, options?: HttpServiceOptions): Promise<HttpServiceResponse<T>>; static delete<T = any>(url: string, data?: any, dataType?: string, headers?: any, options?: HttpServiceOptions): Promise<HttpServiceResponse<T>>; static put<T = any>(url: string, data?: any, dataType?: string, headers?: any, options?: HttpServiceOptions): Promise<HttpServiceResponse<T>>; static get<T = any>(url: string, data?: any, dataType?: string, headers?: any, options?: HttpServiceOptions): Promise<HttpServiceResponse<T>>; static parseDataType(dataType: string): { "Content-Type"?: string; Accept?: string; }; static fetch<T = any>(url: string, method?: HttpMethod, data?: any, dataType?: string, headers?: any, options?: HttpServiceOptions): Promise<HttpServiceResponse<T>>; protected static _requestHeadersEachRequest: { name: string; value: string; }[]; }