原 【Flask】遇到的问题 mickelfeng 参与源创会 领取时间:2014-02-12 “源创会”在线下联结了各位 OSCer,推广开源项目和理念,很荣幸有你的参与~ 领取条件:参与过开源中国“源创会”的 OSCer 可以领取

1、The browser (or proxy) sent a request that this server could not understand. (self.flask)

if request.method == 'GET':
    referrer = request.args.get('next', '/')
    return render_template("login.html", next=referrer)
elif request.method == 'POST':

解决:

i think the real issue is how your accessing your form data, if you say

post.text = request.form['body'] 

or w/e, and there isnt any data in form body, you get that error

to fix, access like this

post.text = request.form.get('body','')

which provides a sane default for cases where form[‘body’] is empty

make sure to do the same with request.form[‘title’]

[AF] The browser (or proxy) sent a request that this server could not understand. from flask

Categories 未分类