[Twisted-Python] How to send response 401
Justin Johnson
justinjohnson at fastmail.fm
Tue Jun 10 11:31:11 MDT 2003
Great, that helped. It was returning 500 before adding return '', but
not 401 gets returned.
Thanks.
On 10 Jun 2003 15:55:01 -0000, "Moshe Zadka" <m at moshez.org> said:
> 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/
>
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>
More information about the Twisted-Python
mailing list