summaryrefslogtreecommitdiffstats
path: root/examples/request.js
blob: 1b032544d5f8aa75c55d1a69afaa62d93cd3e0ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
'use strict'

const { request } = require('../')

async function main () {
  const {
    statusCode,
    headers,
    body
  } = await request('http://localhost:3001/')

  const data = await body.text()
  console.log('response received', statusCode)
  console.log('headers', headers)
  console.log('data', data)
}

main()