def METHOD_NAME(self, request):
    string_to_sign = ''
    x_ms_headers = []
    for name, value in request.headers.items():
        if name.startswith('x-ms-'):
            x_ms_headers.append((name.lower(), value))
    x_ms_headers.sort()
    for name, value in x_ms_headers:
        if value is not None:
            string_to_sign += ''.join([name, ':', value, '\n'])
    return string_to_sign