https://github.com/eldoy/spett
Thin HTTP Client
https://github.com/eldoy/spett
Last synced: about 1 year ago
JSON representation
Thin HTTP Client
- Host: GitHub
- URL: https://github.com/eldoy/spett
- Owner: eldoy
- Created: 2022-04-17T23:15:08.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-05-14T01:02:43.000Z (about 4 years ago)
- Last Synced: 2025-02-22T19:24:52.816Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 7.81 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Spett HTTP Client
Thin HTTP Client.
Automatically converts JSON data to objects if the content type is `application/json`.
### Install
```
npm i spett
```
### Usage
```js
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'})
```
ISC Licensed. Enjoy!