code: def generate_canonical_request(method, parsed_url, headers, signed_headers, content_sha256):
      
      lines = [method, parsed_url.path, parsed_url.query]
  
      # Headers added to canonical request.
      header_lines = []
      for header in signed_headers:
          value = headers[header.title()]
          value = str(value).strip()
          header_lines.append(header + ':' + str(value))
  
      lines = lines + header_lines
      lines.append('')
  
      lines.append(';'.join(signed_headers))
      lines.append(content_sha256)
      return '\n'.join(lines)
docs: Generate canonical request.
  
      :param method: HTTP method.
      :param parsed_url: Parsed url is input from :func:`urlsplit`
      :param headers: HTTP header dictionary.
      :param content_sha256: Content sha256 hexdigest string.