1.0.11 • Published 2 years ago

http-ed v1.0.11

Weekly downloads
-
License
ISC
Repository
github
Last release
2 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

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago