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

wireshark - USB mapping with python -

c++ - nodejs socket.io closes connection before upgrading to websocket -

iphone - UIScrolview Prioritize vertical and horizontal scrolling -