[mod_python] Problem getting the Publisher handler to return nothing

Charles Collis charles.collis at gmail.com
Sat Feb 2 14:30:11 EST 2008


Fantastic, that did the trick!

I have updated the FAQ accordingly (
http://www.modpython.org/FAQ/faqw.py?req=all#2.19). Although the FAQ entry
still mentions "forcing a 200 response" - and I'm not actually sure whether
"raise apache.SERVER_RETURN, apache.HTTP_NO_CONTENT" is still forcing a 200
response or not. If that is now inaccurate perhaps some who knows could
tweak the FAQ entry.

Anyway, thanks for all the help, much appreciated.

Charles.

On Feb 1, 2008 12:20 AM, Graham Dumpleton <graham.dumpleton at gmail.com>
wrote:

> On 01/02/2008, Charles Collis <charles.collis at gmail.com> wrote:
> > Hadn't tried it before, but have now - unfortunately still no joy.
> >
> > If I return 'apache.HTTP_NO_CONTENT' my browser then shows a blank page
> with
> > '24' at the top which presumably is the code for 'HTTP_NO_CONTENT'.
> >
> > If I raise the error:
> >
> > raise apache.HTTP_NO_CONTENT, apache.OK (whether I put ',apache.OK'
> there or
> > not),
>
> Use:
>
>  raise apache.SERVER_RETURN, apache.HTTP_NO_CONTENT
>
> I am not sure though whether that will still trigger Apache to send a
> default error page. You may have to use:
>
>  req.status = apache.HTTP_NO_CONTENT
>  raise apache.SERVER_RETURN, apache.DONE
>
> to be absolutely sure that Apache doesn't further process it.
>
> Graham
>
> > I get an error message in browser saying:
> > 'TypeError: exceptions must be classes, instances, or strings
> (deprecated),
> > not int'
> >
> >
> >
> > >
> > >
> > >
> > >
> > > Have you tried returning apache.HTTP_NO_CONTENT ?
> > > According to [0],
> > > http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
> > this should
> > > cause clients do nothing. As the behaviour of the client cannot be
> > > controlled except for a status code in the header, this might be an
> > > option easier than creating internal requests using Ajax.
> > >
> >
> >
> > _______________________________________________
> > Mod_python mailing list
> > Mod_python at modpython.org
> > http://mailman.modpython.org/mailman/listinfo/mod_python
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20080202/ec951277/attachment.html


More information about the Mod_python mailing list