我使用了 angular-ui-select ,正在选择一些像这样的int类型的ID
9,2,3
。我正在尝试将这些值作为integer
列表传递给python文件,如此
param += '"lstRole":[' + $scope.multipleDemo.roles +']';
抛出错误
Nonetype object is not iterable
当我把这个参数传递给
时param += '"lstRole":"[' + $scope.multipleDemo.roles +']"';
它收到字符串列表并抛出错误
invalid literal for int() with base 10
任何人都可以提到我的错误吗?
答案 0 :(得分:0)
在你的python函数中尝试这个:
json_str = request.body.decode('utf-8')
py_str = json.loads(json_str)
print(py_str["lstRole"])