我试图通过ajaxpost将数据传递到当前的pyapi,但在打印传递的值时总是得到ImmytableMultiDict<[]>
。你知道吗
代码如下:
@app.route('/users/new', methods=['POST'])
@handle_exceptions_in_web_views
def intromeeting():
print(request.args)
firstname, lastname = parse_user_request_args(request.args)
def parse_user_request_args(args):
firstname = args.get('firstName') or ''
lastname = args.get('lastName') or ''
return firstname, lastname
js代码:
$.post('users/new', {
firstName: 'test first name',
lastName: 'test last name'
}).done(function(res){
console.log(res)
}).fail(function (err){
console.log(err)
});
我也尝试使用$.ajax
,但得到了相同的结果。我应该将数据移动到窗体还是smth?你知道吗
目前没有回答
相关问题 更多 >
编程相关推荐