可能是由于未授权的问题。需要在终端节点身份验证中添加适当的身份验证方法。
以下是Python代码示例:
# 导入所需的库和模块
import requests
import json
# 构建要发送的请求
data = {
"Inputs": {
"input1": {
"ColumnNames": ["column1", "column2", "..."],
"Values": [
["value1", "value2", "..."],
["value1", "value2", "..."],
"..."
]
}
},
"GlobalParameters": {}
}
body = str.encode(json.dumps(data))
# 替换Endpoint URL和API密钥
url = 'https:///batch?api-version=2.0'
api_key = ''
# 设置请求头
headers = {
'Content-Type': 'application/json',
'Authorization': ('Bearer ' + api_key)
}
# 发送POST请求
response = requests.post(url, body, headers=headers)
# 解析响应
result = response.text
print(result)
请注意,要将Endpoint URL和API密钥替换为您的值。