code: function RequestSigner(request, credentials) {
  
    if (typeof request === 'string') request = url.parse(request)
  
    var headers = request.headers = (request.headers || {}),
        hostParts = this.matchHost(request.hostname || request.host || headers.Host || headers.host)
  
    this.request = request
    this.credentials = credentials || this.defaultCredentials()
  
    this.service = request.service || hostParts[0] || ''
    this.region = request.region || hostParts[1] || 'us-east-1'
  
    // SES uses a different domain from the service name
    if (this.service === 'email') this.service = 'ses'
  
    if (!request.method && request.body)
      request.method = 'POST'
  
    if (!headers.Host && !headers.host) {
      headers.Host = request.hostname || request.host || this.createHost()
  
      // If a port is specified explicitly, use it as is
      if (request.port)
        headers.Host += ':' + request.port
    }
    if (!request.hostname && !request.host)
      request.hostname = headers.Host || headers.host
  
    this.isCodeCommitGit = this.service === 'codecommit' && request.method === 'GIT'
  }
docs: request: { path | body, [host], [method], [headers], [service], [region] } credentials: { accessKeyId, secretAccessKey, [sessionToken] }