From the render_GET method of a Resource in twisted, is it possible to redirect to a different url entirely (hosted elsewhere)
request.redirect(url) doesn’t appear to do anything, and neither does twisted.web.util.Redirect
The equivalent in php would be,
header('location:'.$url);
EDIT
this is the code I’m running
from twisted.web import server, resource
from twisted.internet import reactor
class Simple(resource.Resource):
isLeaf = True
def render_GET(self, request):
request.redirect("www.google.com")
request.finish()
site = server.Site(Simple())
reactor.listenTCP(8080, site)
reactor.run()
I worked it out in the end with help from the other poster, with
request.finish(), the redirect includinghttp://and returningNOT_DONE_YET