def render(self, request):
        """
        Send www-authenticate headers to the client
        """
        def generateWWWAuthenticate(scheme, challenge):
            l = []
            for k,v in challenge.items():
                l.append(networkString("%s=%s" % (k, quoteString(v))))
            return b" ".join([scheme, b", ".join(l)])

        def quoteString(s):
            return '"%s"' % (s.replace('\\', '\\\\').replace('"', '\\"'),)

        request.setResponseCode(401)
        for fact in self._credentialFactories:
            challenge = fact.getChallenge(request)
            request.responseHeaders.addRawHeader(
                b'www-authenticate',
                generateWWWAuthenticate(fact.scheme, challenge))
        if request.method == b'HEAD':
            return b''
        return b'Unauthorized'
dataset/ETHPy150Open twisted/twisted/twisted/web/_auth/wrapper.py/UnauthorizedResource.render/original