0.1.1 • Published 9 years ago
@koax/fetch-json v0.1.1
fetch-json
Fetch json sugar.
Installation
$ npm install @koax/fetch-json
Usage
import koax from 'koax'
import {fetchEffect} from '@koax/fetch'
import {post} from '@koax/fetch-json'
let app = koax()
app.use(fetchEffect)
app(post('https://slack.com/api/chat.postMessage', {
token: 'secret',
channel: 'C1234567890',
text: 'Hello world'
})).then(res => res.body) // {ok: true ...}
API
get(url, params)
url
- url stringparams
- parameters to put in body (should we put in url for get?)
Returns: FETCH action
post(url, params)
url
- url stringparams
- parameters to put in body
Returns: FETCH action
License
MIT
0.1.1
9 years ago