Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/pfrazee/http-template-literal
- Owner: pfrazee
- Created: 2017-02-10T21:37:39.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2021-04-06T10:05:10.000Z (over 3 years ago)
- Last Synced: 2024-11-09T17:46:29.004Z (about 2 months ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 197
- Watchers: 4
- Forks: 16
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
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)
```