web - Bottle server to accept question mark as input in Python -
i writing following code:
bottle import route, run @route('/input/') def greet(name): return name
run(host='localhost', port=8080, debug=true)
however, when try access this: http://localhost:8080/input/?hi
i following error: sorry, requested url 'http://localhost:8080/input/?hi' caused error: not found: '/input/'
i need parse whole string "?hi" input string in method "inpout"
i have tried replicate issue, have not had success. version of bottle using?
below altered version of code have print "hello (name)" variable.
from bottle import route, run, request @route('/input/') def greet(): return "hello " + request.query.get("name") run(host='localhost', port=8080, debug=true)
hitting http://localhost:8080/input/?name=shaklasah
result in hello shaklasah
Comments
Post a Comment