我正在尝试使用 python 发布请求,状态代码为 200,但该对象未在服务器上创建。换句话说,我正在尝试将数据发布到 API 文档,但该帖子并未在 API 主机名中生成,尽管 200 ok(状态码)。
headers2 = {
'user': 'myuser',
'Version': '10.0',
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Bearer MyKey'
}
for link in url_to_upload:
data = {"name": "Malicious Links", "value": link, "source": "API Script"}
req = requests.post('https://api_hostname/api/reference_data/sets', headers=headers2, data=data, verify=False)
if req.status_code == 200:
continue
else:
print("Hey There! I'm sorry, but there's a problem with posting it")