[Twisted-Python] How to send response 401

Moshe Zadka m at moshez.org
Tue Jun 10 11:55:01 EDT 2003


On Tue, 10 Jun 2003, "Justin Johnson" <justinjohnson at fastmail.fm> wrote:

> 	def render(self, request):
...
> 		if headers.has_key("authorization"):
...
> 		else:
> 			log("User not authorized")
> 			request.setResponseCode(http.UNAUTHORIZED)
You want to add
                        return ''
Or maybe return '<html>nice error message</html>'

-- 
Moshe Zadka -- http://moshez.org/
Buffy: I don't like you hanging out with someone that... short.
Riley: Yeah, a lot of young people nowadays are experimenting with shortness.
Agile Programming Language -- http://www.python.org/




More information about the Twisted-Python mailing list