我正在尝试使用python发布请求,状态代码为200,但该对象未在服务器上创建。换句话说,我试图将数据发布到API文档,但是尽管200 OK(状态代码),但该发布不会在API主机名中生成。
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")