1 |
|
2 | import { Response } from 'got';
|
3 | import { Configuration } from './Configuration';
|
4 | export declare type Body = ({
|
5 | [key: string]: any;
|
6 | } | string | Buffer | null);
|
7 | export declare enum Method {
|
8 | GET = "GET",
|
9 | PUT = "PUT",
|
10 | POST = "POST",
|
11 | DELETE = "DELETE"
|
12 | }
|
13 | export declare type Options = {
|
14 | configuration: Configuration;
|
15 | headers?: {
|
16 | [headerName: string]: string;
|
17 | };
|
18 | jsonRequest?: boolean;
|
19 | jsonResponse?: boolean;
|
20 |
|
21 | json?: boolean;
|
22 | method?: Method;
|
23 | };
|
24 | export declare function request(target: string, body: Body, { configuration, headers, json, jsonRequest, jsonResponse, method }: Options): Promise<Response<any>>;
|
25 | export declare function get(target: string, { configuration, json, jsonResponse, ...rest }: Options): Promise<any>;
|
26 | export declare function put(target: string, body: Body, options: Options): Promise<Buffer>;
|
27 | export declare function post(target: string, body: Body, options: Options): Promise<Buffer>;
|
28 | export declare function del(target: string, options: Options): Promise<Buffer>;
|