python tornado get request url -


here code:

class mainhandler(tornado.web.requesthandler):     def get(self):         self.write(self.request.url)  def main():     settings = {"template_path": "html","static_path": "static"}     tornado.options.parse_command_line()     application = tornado.web.application([        (r"/story/page1", mainhandler),         ],**settings) 

i want string "/story/page1". how ?

you can current url inside requesthandler using self.request.uri:

class mainhandler(tornado.web.requesthandler):     def get(self):         self.write(self.request.uri) 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Socket.connect doesn't throw exception in Android -

iphone - How do I keep MDScrollView from truncating my row headers and making my cells look bad? -