标签: python-requests httprequest
我目前正在使用这种笨拙的方式来检查请求是HTTP还是HTTPS
def get_scheme(self, request): if self.request.url.startswith('https:'): scheme = 'https' else: scheme = 'http'
Python请求中是否有request.is_secure()方法?
request.is_secure()