1.6.0 • Published 4 years ago

@rabbotio/fetcher v1.6.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

fetcher

Simply fetch get/post as json

import { getJSON, postJSON } from '@rabbotio/fetcher'

// get JSON
const json = await getJSON(`https://bx.in.th/api/`)
console.log(json)

// post JSON with params
const json = await postJSON(`${this.facebookURL}?access_token=${accessToken}`, {
  recipient: {
    id: recipientId
  },
  message: {
    text: messageText
  }
})
console.log(json)

// get JSON with params
const json = await getJSON(`https://bx.in.th/api/tradehistory/`, {
  pairing: 1,
  date: '2017-12-12'
})
console.log(json)

// passing headers
const json = await postJSON('https://api.line.me/v2/bot/message/reply', {
    replyToken: replyToken,
    messages: messages
  }, {
  'Authorization': `Bearer ${accessToken}`,
})
console.log(json)
1.6.0

4 years ago

1.5.0

4 years ago

1.4.0

5 years ago

1.3.0

6 years ago

1.2.0

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago