docs: function request (options, session) {
      // require options and session to be objects
      options = requireValidOptionalObject(options)
      session = requireValidOptionalObject(session)
      // if automock function is set then call and return it unless
      // the automock session flag is false
      if (automockRequest && session.automock !== false) {
          // call automock wrapper
          return automockRequest.apply(this, arguments)
      }
      // get request id
      var uniqueId = randomUniqueId()
      // http request log id
      logHttpRequest(uniqueId, options, session)
      // always resolve with full response for logging
      options.resolveWithFullResponse = true
      // set json flag by default if body is object
      if (options.json === undefined && typeof options.body === 'object') {
          options.json = true
      }
      // set simple mode to only reject on transport and other tech
      // errors - resolve on 404 and other HTTP errors
      options.simple = false
      // debug
      debug('http request', options)
      // make request
      return rp(options)
      // log success
      .then(res => {
          debug('http response', res)
          // parse json response
          if (options.json === undefined && res.headers['content-type'] === 'application/json') {
              res.body = JSON.parse(res.body)
          }
          // remove all non-critical data from response
          var cleanedRes = cleanRes(res)
          // log response
          logHttpResponse(uniqueId, cleanedRes)
          // return modified response
          return cleanedRes
      })
      // log error
      .catch(err => {
          debug('http error', err)
          logHttpRequestError(uniqueId, err)
          // reject promise
          return Promise.reject(err)
      })
  }