#gives 303 See Other
if '/generate_204' in uri: cherrypy.response.status = '204'
raise cherrypy.HTTPRedirect('/')
#complains about error code < 300
if '/generate_204' in uri:
raise cherrypy.HTTPError(204)
def global_redirect(urls=None): if urls: uri=cherrypy.url() print(uri) if '/generate_204' in uri: cherrypy.response.status = '204' cherrypy.response.headers['Content-Location'] = '/'
cherrypy.tools.global_redirect = cherrypy.Tool( 'before_handler', global_redirect, priority=20)
raise cherrypy.HTTPRedirect(...)
Code hier eingeben...class Error204(cherrypy.HTTPError): def __init__(self, message=None): self.status = 204 self._message = message cherrypy.CherryPyException.__init__(self, 204, message)--
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cherrypy-user...@googlegroups.com.
To post to this group, send email to cherryp...@googlegroups.com.
Visit this group at http://groups.google.com/group/cherrypy-users.
For more options, visit https://groups.google.com/d/optout.