python - + sign eliminates in web.py input parameters (GET request) -


i have following code takes input parameter t , return same value.

import web  urls = (     '/test(.*)', 'test',  ) class test(web.storage):      def get(self,r):        t = web.input().q        print t        return t  if __name__ == "__main__":      app = web.application(urls, globals())     app.run() 

so works correctly when execute following url in browser

http://localhost:8080/test?q=word1-word2

but when there + sign eliminates that.

http://localhost:8080/test?q=word1+word2

and returns

word1 word2

where expected result

word1+word2

how can prevent this?

try url encoding query string:

http://localhost:8080/test?q=word1%2bword2 

as + used replace space.


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -