Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/pfrazee/http-template-literal

Make HTTP requests the way TBL intended.
https://github.com/pfrazee/http-template-literal

Last synced: about 1 month ago
JSON representation

Make HTTP requests the way TBL intended.

Awesome Lists containing this project

README

        

# http-template-literal

Make HTTP requests the way TBL intended.

```javascript
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)
```