0.2.2 • Published 4 years ago
yahp v0.2.2
YAHP (Yet another HTTP client package)

Yet another node.js http client library that solves all your needs.
Installation
npm install yahpHow to make requests?
GET request.
var client = require('yahp');
var response = client.get('https://www.google.com/');POST request.
var client = require('yahp');
var response = client.post('http://localhost:3000/', {
contentType: 'application/json',
data: {
name: 'Goutam'
}
});Similarly, you can use put, patch, and delete methods respectively.
How to make authenticated requests?
Just use auth property to make basic authenticated requests.
var client = require('yahp');
var response = client.get('http://localhost:3000/protected', {
auth: 'user:password'
});To make other requests like Token, Bearer authentication mechanisms.
var client = require('yahp');
var response = client.get('http://localhost:3000/protected', {
headers: {
Authorization: 'Bearer token'
}
});Made with 💓 in 🇮🇳.