getのrequestのとき、urlの中にあるパラメータを取りたいの場合:
# testing route to return the get url parasmeters @app.route('/dataGet') def dataGet(): x=request.query_string y=x.decode("utf-8").split('&') print(y) return 'hello wolrd'
http://localhost:5000/dataGet?var1&var1&var3 なら
['var1','var2','var3']
http://localhost:5000/dataGet なにもないとき
['']
flask.requeset documents
query_string
The URL parameters as raw bytestring.
参考Link:
https://stackoverflow.com/questions/606191/convert-bytes-to-a-string
https://stackoverflow.com/questions/11774265/how-do-you-get-a-query-string-on-flask