docs: function request (reqOptions, data) {
    const t = require('typical')
    if (!reqOptions) return Promise.reject(Error('need a URL or request options object'))
    if (t.isString(reqOptions)) {
      const urlUtils = require('url')
      reqOptions = urlUtils.parse(reqOptions)
    } else {
      reqOptions = Object.assign({ headers: {} }, reqOptions)
    }
  
    let transport
    const protocol = reqOptions.protocol
    if (protocol === 'http:') {
      transport = require('http')
    } else if (protocol === 'https:') {
      transport = require('https')
    } else {
      return Promise.reject(Error('Protocol missing from request: ' + JSON.stringify(reqOptions, null, '  ')))
    }
  
    const defer = require('defer-promise')
    const deferred = defer()
    const req = transport.request(reqOptions, function (res) {
      const pick = require('lodash.pick')
      if (/text\/event-stream/.test(res.headers['content-type'])) {
        const util = require('util')
        res[util.inspect.custom] = function (depth, options) {
          return options.stylize('[ SSE event-stream ]', 'special')
        }
        deferred.resolve({
          data: res,
          res: pick(res, [ 'headers', 'method', 'statusCode', 'statusMessage', 'url' ]),
          req: reqOptions
        })
      } else {
        const streamReadAll = require('stream-read-all')
        streamReadAll(res).then(data => {
          /* statusCode will be zero if the request was disconnected, so don't resolve */
          if (res.statusCode !== 0) {
            deferred.resolve({
              data: data,
              res: pick(res, [ 'headers', 'method', 'statusCode', 'statusMessage', 'url' ]),
              req: reqOptions
            })
          }
        })
      }
    })
  
    req.on('error', function reqOnError (err) {
      /* failed to connect */
      err.name = 'request-fail'
      err.request = req
      deferred.reject(err)
    })
  
    req.end(data)
  
    if (reqOptions.controller) {
      reqOptions.controller.abort = function () {
        req.abort()
        const err = new Error('Aborted')
        err.name = 'aborted'
        deferred.reject(err)
      }
    }
  
    return deferred.promise
  }