code: def gen_str_to_sign(self, req):
          
          url = urlsplit(req.url)
          bucket_name = url.netloc.split(".", 1)[0]
  
          logger.debug(req.headers.items())
          ucloud_headers = [
              (k, v.strip())
              for k, v in sorted(req.headers.lower_items())
              if k.startswith("x-ucloud-")
          ]
          canonicalized_headers = "\n".join([
              "{0}:{1}".format(k, v) for k, v in ucloud_headers
          ])
  
          canonicalized_resource = "/{0}{1}".format(
              bucket_name,
              unquote(url.path)
          )
  
          str_to_sign = "\n".join([
              req.method,
              req.headers.get("content-md5", ""),
              req.headers.get("content-type", ""),
              req.headers.get("date", self._expires),
              canonicalized_headers + canonicalized_resource
          ])
          return str_to_sign
docs: Generate string to sign using giving prepared request