outers
Version:
outers - a all in one package for your day to day use
57 lines (56 loc) • 3.77 kB
TypeScript
type str = string;
/**
* The function `PostFetch` is an asynchronous function that sends a POST request to an API with the
* provided data and headers, and returns the response as a JSON object.
* @param {str} API - The API parameter is a string that represents the URL of the API endpoint you
* want to send the POST request to. It should be a valid URL.
* @param {any} Data - The `Data` parameter is the data that you want to send in the POST request.
* It can be of any type, but it will be converted to a JSON string using `JSON.stringify()` before
* sending it in the request body.
* @param Headers - The `Headers` parameter is an optional parameter that allows you to specify custom
* included in the HTTP request. By default, it is set to `{ 'Content-Type': 'application/json' }`,
* which means that the request body will be in JSON format. However, you can override this default
* value by
* @returns a Promise that resolves to an any value.
*/
export declare function PostFetch(API: str, Data: any, Responsejson?: boolean, Headers?: any): Promise<any>;
/**
* The function `GetFetch` is an asynchronous function that fetches data from an API using the GET
* method and returns the response as JSON.
* @param {str} API - The API parameter is a string that represents the URL of the API you want to
* fetch data from. It should be a valid URL that points to the API endpoint.
* @param Headers - The `Headers` parameter is an optional parameter that allows you to specify custom
* included in the request. In this case, the default value is `{ 'Content-Type': 'application/json'
* }`, which sets the `Content-Type` header to `application/json`. This header indicates that the
* request body will
* @returns a Promise that resolves to an any value.
*/
export declare function GetFetch(API: str, Responsejson?: boolean, Headers?: any): Promise<any>;
/**
* The function `PutFetch` is an asynchronous function that sends a PUT request to an API with the
* provided data and headers, and returns the response as JSON.
* @param {str} API - The API parameter is a string that represents the URL of the API endpoint you
* want to send the PUT request to. It should include the protocol (e.g., "https://") and any necessary
* path or query parameters.
* @param {any} Data - The `Data` parameter is the data that you want to send in the PUT request.
* It can be of any type, but it will be converted to a JSON string using `JSON.stringify()` before
* sending it in the request body.
* @param Headers - The `Headers` parameter is an optional parameter that allows you to specify custom
* headers for the PUT request. By default, it is set to `{ 'Content-Type': 'application/json' }`,
* which sets the content type of the request to JSON. However, you can override this value by passing
* your
* @returns a Promise that resolves to an any value.
*/
export declare function PutFetch(API: str, Data: any, Responsejson?: boolean, Headers?: any): Promise<any>;
/**
* The above function is an asynchronous function that sends a DELETE request to an API and returns the
* response as a JSON object.
* @param {str} API - The API parameter is a string that represents the URL of the API endpoint that
* you want to send the DELETE request to. It should be a valid URL.
* @param Headers - The `Headers` parameter is an optional parameter that allows you to specify custom
* included in the DELETE request. By default, it is set to `{ 'Content-Type': 'application/json' }`,
* which sets the content type of the request to JSON. However, you can pass a different set of headers
* @returns a Promise that resolves to an any value.
*/
export declare function DeleteFetch(API: str, Responsejson?: boolean, Headers?: any): Promise<any>;
export {};