Flask form submit: request.stream.read() contais data, but request.form doesn't -
i'm trying submit simpliest form ever:
<form class="form-search" action='/render' method="post"> <input name='test' type="text" class="input-medium search-query"> <button type="submit" class="btn">search</button> </form>
(that's bootstrap, , i've taken raw example site)
...to simpliest handler ever:
@app.route('/render', methods=['post', 'get']) def render(): if request.method == 'post': print request.stream.read() print request.data print request.form return 'ok'
and that's i've got:
>> test=1 >> >> immutablemultidict([])
i'm confused: seems simple. i've seen couple of same-looking problems - issue missing input 'name' attribute, seems different case. thanks.
oh, i've figured out. looks when request.stream.read()
, empties request.form
dictionary.
Comments
Post a Comment