1.0.11 • Published 3 years ago

http-ed v1.0.11

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

Method

Repository method

FunctionDescription
getRequest(url: string): Promise<any>Sends a GET request to the specified URL.
postRequest(url: string, body: any): Promise<any>Sends a POST request to the specified URL with the data in the body.
getRequestBearer(url: string, token: string): Promise<any>Sends an authenticated GET request to the specified URL with the provided token.
postRequestBearer(url: string, token: string, body: any): Promise<any>Sends an authenticated POST request to the specified URL with the data in the body and the provided token.

Example

import { postRequest } from "http-ed";

export const fetchData = async (payload) => {
    let url = `your api`;
    return postRequest(url, payload.body);
};
1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago