0.1.2 • Published 2 years ago
spett v0.1.2
Spett HTTP Client
Thin HTTP Client.
Automatically converts JSON data to objects if the content type is application/json
.
Install
npm i spett
Usage
const request = require('spett')
// Default options
const options = {
host: 'localhost',
port: '9090',
path: '/',
method: 'POST',
headers: {
'content-type': 'application/json'
}
}
// The data, the status code and the response object
const { data, code, res } = await request({ path: '/hello'}, options)
ISC Licensed. Enjoy!