这是我的代码:
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/"}
答案 0 :(得分:0)
我发现我应该将data=data
更改为json=data