1.1.1 • Published 2 years ago

@woojinson/http-client v1.1.1

Weekly downloads
-
License
GPL-3.0
Repository
github
Last release
2 years ago

HTTP Client

Usage

To use the package, install it using npm:

npm install @woojinson/http-client

Then include it in your file:

// CommonJS
const httpClient = require('@woojinson/http-client');

// EczemaScript 6
import * as httpClient from '@woojinson/http-client';

Then, you can use the library. As an example:

httpClient.get('https://example.com', (res) => {
    console.log(res);
});

API Reference

get(url: string, callback: (res: any) => void, headers?: any): void

Makes a GET request.

post(url: string, data: any, callback: (res: any) => void, dataType?: ContentType, headers?: any): void

Makes a POST request.

put(url: string, data: any, callback: (res: any) => void, dataType?: ContentType, headers?: any): void

Makes a PUT request.

patch(url: string, data: any, callback: (res: any) => void, dataType?: ContentType, headers?: any): void

Makes a PATCH request.

del(url: string, callback: (res: any) => void, headers?: any): void

Makes a DELETE request.

1.1.1

2 years ago

1.1.0

2 years ago

1.0.2

2 years ago

1.0.1

3 years ago

1.0.0

3 years ago