Search code examples
regexurlhttprequesttornadopath-parameter

Can we access URL's path parameters in a Tornado RequestHandler?


I know that in Tornado one can capture some parts of URL's using regular expressions, but isn't there a more structured way to access path parameters? Maybe something similar to the way you access query arguments (RequestHandler.get_query_argument())?


Solution

  • The answer is no. Tornado doesn't know anything about what's inside path segments. The only way to access more detailed information, codified in path segments, is to use regular expressions.