UNPKG

@logi.one/rest-client

Version:

This is a free, ultra-lightweight and easy to use rest client for node.js supporting JSON requests and streams with no external dependencies.

11 lines (10 loc) 1.19 kB
import { RequestOptions, RequestOptionsWithSchema } from './request-options'; import { StandardSchemaV1 } from './standard-schema.v1'; export declare function getJSON<T extends StandardSchemaV1>(url: string, options: RequestOptionsWithSchema<undefined, T>): Promise<StandardSchemaV1.InferOutput<T>>; export declare function getJSON<T>(url: string, options?: RequestOptions<undefined>): Promise<T>; export declare function deleteJSON<T extends StandardSchemaV1>(url: string, options: RequestOptionsWithSchema<undefined, T>): Promise<StandardSchemaV1.InferOutput<T>>; export declare function deleteJSON<T>(url: string, options?: RequestOptions<undefined>): Promise<T>; export declare function putJSON<T extends StandardSchemaV1>(url: string, options: RequestOptionsWithSchema<unknown, T>): Promise<StandardSchemaV1.InferOutput<T>>; export declare function putJSON<T>(url: string, options?: RequestOptions<unknown>): Promise<T>; export declare function postJSON<T extends StandardSchemaV1>(url: string, options: RequestOptionsWithSchema<unknown, T>): Promise<StandardSchemaV1.InferOutput<T>>; export declare function postJSON<T>(url: string, options?: RequestOptions<unknown>): Promise<T>;