我正在学习如何使用这个 API,首先,我想运行一个简单的程序,这就是发生的事情:代码:
subscription_key = "**"
assert subscription_key
face_api_url = 'https://southeastasia.api.cognitive.microsoft.com/face/v1.0/verify'
headers = {'Ocp-Apim-Subscription-Key': subscription_key}
params = {
'faceId1': '03ab5c58-86bb-4eef-a89e-56d4ce76e95b',
'faceId2': '05113848-2c22-4116-8a30-5cde938eec61'
}
import requests
from pprint import pprint
response = requests.post(face_api_url, headers=headers, params=params)
faces = response.json()
pprint(faces)
输出:
{'error': {'code': 'BadArgument', 'message': 'Request body is invalid.'}}