http-template-literal

1.0.2 • Public • Published

http-template-literal

Make HTTP requests the way TBL intended.

const http = require('http-template-literal')

var res = await http`
  GET https://httpbin.org/get HTTP/1.1
  Accept: application/json
`
console.log('Request one:', res.body)

var res = await http`
  POST https://httpbin.org/post HTTP/1.1
  Content-Type: application/json

  ${JSON.stringify({
    hello: 'world',
    awesome: true
  })}
`
console.log('Request two:', res.body)

FAQ

Oh cool, should I use this?

No.

Package Sidebar

Install

npm i http-template-literal

Weekly Downloads

1

Version

1.0.2

License

MIT

Last publish

Collaborators

  • pfraze