Wednesday, 15 April 2015

python - webapp2 route containing regex does not work -


To enable feedback content formatting, I want to use the following regex in some of my routes: < Pre> redirectRoute (r '/ mypath / & lt ;: | json | xml & gt;', handler = myhandler, handler_method = 'mymethod', name = 'myhandler = mymethod', methods = ['post'] Post / MyPath Return HTML

  • / Li>

    Router class support regular expression Try out all internal variables

      redirectRoute ('/ mypath & lt; format: | / xml | / json' ;, handler = myhandler, handler_method = 'mymethod', name = 'Myhandler = mymethod', methods = [ 

    name format: 'POST'], strict_slash = true)

    The slash strip has to be leading from the value obtained in the requirement. requires a variable because I had an bad request error in case of / mypath / (with the termination of the slash) if it is empty (& Lt; :) Request The error occurs when the webpage tries to make the URL for the redirect to code / mypath as the password_slash = true. I think you had the same error.

  • No comments:

    Post a Comment