1.1.1 • Published 2 years ago
@woojinson/http-client v1.1.1
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.