我在运行代码时遇到此错误,响应中包含无法读取的关键字json。
错误:
Traceback (most recent call last):
File "C:\Users\tomst\Documents\Pycharm_Projects\Github_FaceRog\person_group.py", line 15, in <module>
res = CF.person_group.create("ttpersons")
File "C:\Users\tomst\AppData\Local\Programs\Python\Python37-32\lib\site-packages\cognitive_face\person_group.py", line 32, in create
return util.request('PUT', url, json=json)
File "C:\Users\tomst\AppData\Local\Programs\Python\Python37-32\lib\site-packages\cognitive_face\util.py", line 92, in request
headers=headers)
File "C:\Users\tomst\AppData\Local\Programs\Python\Python37-32\lib\site-packages\requests\api.py", line 44, in request
return session.request(method=method, url=url, **kwargs)
TypeError: request() got an unexpected keyword argument 'json'
代码:
import sys
import cognitive_face as CF
Key = '4d443a3c323043868219d5dc2e064d04'
CF.Key.set(Key)
BASE_URL = 'https://westcentralus.api.cognitive.microsoft.com/face/v1.0'
CF.BaseUrl.set(BASE_URL)
res = CF.person_group.create("ttpersons")