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 -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -