eve REST API 以及如何 post 基于角色的身份验证的角色列表
eve REST API and how to post a role list for role based authentication
我正在尝试像 http://python-eve.org/tutorials/account_management.html#b-user-roles-access-control
中一样重新创建基于角色的身份验证
API 是 运行,我可以在没有角色的情况下添加帐户,但是当我像上面那样实现角色时 link 并尝试 post通过 Pycharms REST 客户端角色我得到:
{"_status": "ERR", "_issues":
{"roles": "must be of list type"},
"_error":
{"message": "Insertion failure: 1 document(s) contain(s) error(s)", "code": 422}}
我尝试了很多不同的方法来 post 角色,例如 roles[]=user
的变体,但是如果我在 REST 客户端的输入字段中输入除了角色之外的任何其他内容,我会得到一些东西像 "no field roles[], roles required" 等...
有人可以帮我列出 post 个角色吗?
PS:当我尝试使用 "Advanced REST client" 或 "POSTMAN" 等其他内容时,我得到:
File "C:\Python27\lib\site-packages\flask\app.py", line 1465, in find_handler
handler = handler_map.get(cls)
AttributeError: 'function' object has no attribute 'get'
127.0.0.1 - - [04/Nov/2016 14:29:42] "POST /accounts HTTP/1.1" 500 -
我正在尝试像 http://python-eve.org/tutorials/account_management.html#b-user-roles-access-control
中一样重新创建基于角色的身份验证API 是 运行,我可以在没有角色的情况下添加帐户,但是当我像上面那样实现角色时 link 并尝试 post通过 Pycharms REST 客户端角色我得到:
{"_status": "ERR", "_issues":
{"roles": "must be of list type"},
"_error":
{"message": "Insertion failure: 1 document(s) contain(s) error(s)", "code": 422}}
我尝试了很多不同的方法来 post 角色,例如 roles[]=user
的变体,但是如果我在 REST 客户端的输入字段中输入除了角色之外的任何其他内容,我会得到一些东西像 "no field roles[], roles required" 等...
有人可以帮我列出 post 个角色吗?
PS:当我尝试使用 "Advanced REST client" 或 "POSTMAN" 等其他内容时,我得到:
File "C:\Python27\lib\site-packages\flask\app.py", line 1465, in find_handler
handler = handler_map.get(cls)
AttributeError: 'function' object has no attribute 'get'
127.0.0.1 - - [04/Nov/2016 14:29:42] "POST /accounts HTTP/1.1" 500 -