如何使用Bugzilla API将用户添加到组中?

时间:2019-02-13 02:03:48

标签: bugzilla

这是我的代码:

data = {
    'groups': [{'add':{'S8','ALL'}}]
    }
    r = requests.put(bugzilla_host + '/rest.cgi/user/user_name?token=' + token, data=data)

然后出现以下错误:

> {"error":true,"message":"Can't use string (\"add\") as a HASH ref
> while \"strict refs\" in use at Bugzilla/User.pm line
> 419.\n","code":100500,"documentation":"https://bugzilla.readthedocs.org/en/5.0/api/"}

1 个答案:

答案 0 :(得分:0)

我发现我应该将data=data更改为json=data