pallets / flask

The Python micro framework for building web applications.
https://flask.palletsprojects.com
BSD 3-Clause "New" or "Revised" License
67.5k stars 16.14k forks source link

request parsing special parameters #5494

Closed liangxiaojian0210 closed 3 months ago

liangxiaojian0210 commented 3 months ago

I want to know when i send "http://127.0.0.1:5000/?name=xiaojiann+&age=16" , why request.query_string can get b'name=xiaojiann+' but request.arg get ImmutableMultiDict([('name', 'xiaojiann ')]), request.args use blank space replace +

image

I try flask version 2.0.3 , 3.0.3 and python version 3.6 , 3.10

davidism commented 3 months ago

Because that's how query string parsing works. You need to percent encode characters with special meanings.