@app.route('/hello')
def hello():
return '', 302, {'Location', 'https//:www.baidu.com'}
报错:ValueError: too many values to unpack (expected 2)
哪位大神指导这是什么原因?
@app.route('/hello')
def hello():
return '', 302, {'Location', 'https//:www.baidu.com'}
报错:ValueError: too many values to unpack (expected 2)
哪位大神指导这是什么原因?
字典里需要使用键值对形式({key: value}
),即:
{'Location': 'https//:www.baidu.com'}
感谢,我也在勘误里面找到了这个问题。