如何将Copyleaks删除API调用?
我一直在尝试删除使用API进行的某些扫描。现在,当我尝试使用此处提供的文档来执行此操作时: https://api.copyleaks .com/documation/v3/ducuntion/delete ,我一直遇到以下错误,即:b'{“ scans”:[“扫描字段是必需的。”,“不能为null”] }'
我正在关注API的文档以创建我的JSON对象并将其传递给request.patch
,但我会遇到相同的错误。
只是为了确保我没有错误地这样做,这是我的代码:
myobj = json.dumps({'scans':[{'id':'43973'}],'purge':'false'})
response = requests.patch('https://api.copyleaks.com/v3.1/education/delete', headers=headers, data=myobj)
如果有人可以为此提供一些指导,那真的很好。
I have been trying to delete certain scans I have made using the API. Now, when I try to do that using documentation provided here : https://api.copyleaks.com/documentation/v3/education/delete, I keep getting the following error which is :b'{"scans":["The scans field is required.","Cannot be null"]}'
I am following the documentation for the API to create my json object and pass it to request.patch
but I keep getting the same error.
Just to be sure I am not doing this incorrectly, here is my code :
myobj = json.dumps({'scans':[{'id':'43973'}],'purge':'false'})
response = requests.patch('https://api.copyleaks.com/v3.1/education/delete', headers=headers, data=myobj)
If someone could provide some guidance with regards to this, it would be really nice.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
确保将内容类型标头设置为应用程序/JSON,例如:
'content-type':'application/json',
编辑:
标题对象应该看起来像这样:
}
make sure you set the content type header to application/json like so:
'Content-type': 'application/json',
EDIT:
the headers object should look like this:
}