0.0.6 • Published 5 years ago
@mezmerik/http v0.0.6
@mezmerik/http
A chaining JavaScript http request utility
- Currently only accepts json responses
Getting Started
Install @mezmerik/http
Installing
Clone the repository
# with npm
npm install @mezmerik/http
# with yarn
yarn add @mezmerik/http
Usage
// With Babel
import http from '@mezmerik/http';
// GET
const response = await http('http://testurl.com/', options = {})
.acceptJson()
.request()
// POST
const response = await http('http://testurl.com/', options = {})
.withJsonBody({
// some json body
})
.acceptJson()
.post()
.request()
// PATCH
const response = await http('http://testurl.com/', options = {})
.withJsonBody({
// some json body
})
.acceptJson()
.patch()
.request()
Built With
Contributing
PR's are welcomed.
Versioning
We follow semver
Authors
- Jake Feldman - Initial work - jakeFeldman
License
This project is licensed under the MIT License - see the LICENSE.md file for details
Acknowledgments
N/A