def METHOD_NAME(self, request):
    verb = request.http_request.method.upper()
    # Get the path and query from url, which looks like https://host/path/query
    parsed_url: ParseResult = urlparse(request.http_request.url)
    query_url = parsed_url.path
    if parsed_url.query:
        query_url += "?" + parsed_url.query
    # Need URL() to get a correct encoded key value, from "%3A" to ":", when transport is in type AioHttpTransport.
    # There's a similar scenario in azure-storage-blob and azure-appconfiguration, the check logic is from there.
    try:
        from yarl import URL
        from azure.core.pipeline.transport import (  # pylint:disable=non-abstract-transport-import
            AioHttpTransport,
        )
        if (
            isinstance(request.context.transport, AioHttpTransport)
            or isinstance(
                getattr(request.context.transport, "_transport", None),
                AioHttpTransport,
            )
            or isinstance(
                getattr(
                    getattr(request.context.transport, "_transport", None),
                    "_transport",
                    None,
                ),
                AioHttpTransport,
            )
        ):
            query_url = str(URL(query_url))
    except (ImportError, TypeError):
        pass
    if self._decode_url:
        query_url = urllib.parse.unquote(query_url)
    signed_headers = "x-ms-date;host;x-ms-content-sha256"
    utc_now = get_current_utc_time()
    if request.http_request.body is None:
        request.http_request.body = ""
    content_digest = hashlib.sha256(
        (request.http_request.body.encode("utf-8"))
    ).digest()
    content_hash = base64.b64encode(content_digest).decode("utf-8")
    string_to_sign = (
        verb
        + "\n"
        + query_url
        + "\n"
        + utc_now
        + ";"
        + self._host
        + ";"
        + content_hash
    )
    signature = self._compute_hmac(string_to_sign)
    signature_header = {
        "x-ms-date": utc_now,
        "x-ms-content-sha256": content_hash,
        "x-ms-return-client-request-id": "true",
        "Authorization": "HMAC-SHA256 SignedHeaders="
        + signed_headers
        + "&Signature="
        + signature,
    }
    request.http_request.headers.update(signature_header)
    return request