1.0.0 • Published 2 years ago
http-client-best v1.0.0
Installation
npm install http-client
APIs
Create New Cliet
import HttpClient from 'http-client';
// or use: const HttpClient = require('http-client').default;
const httpClient = new HttpClient();
const headers = {
'Content-Type': 'application/json',
'Accept': '*/*'
};
const body = {};
const config = {
headers,
body
};
Get
const response = await httpClient.get(url, config);
Post
const response = await httpClient.post(url, config);
Put
const response = await httpClient.put(url, config);
Patch
const response = await httpClient.patch(url, config);
Delete
const response = await httpClient.delete(url, config);
Head
const response = await httpClient.head(url, config);
1.0.0
2 years ago