Check if Python Requests response is http or https

Viewed 363

I am currently using this clumsy way to check if a request is HTTP or HTTPS

def get_scheme(self, request):
    if self.request.url.startswith('https:'):
            scheme = 'https'
        else:
            scheme = 'http'

Is there a request.is_secure() method in Python Requests?

0 Answers
Related