我正在尝试使用带有 Python 的 api 发布请求,通过使用来自以下站点的说明在 WordPress 中发布一些文本:WordPress APi
我的代码:
articleCategories=['Test1']
client = Client('https://wordpress.site.com/xmlrpc.php', 'username','password')
post = WordPressPost()
post.title = 'Test1'
post.content = 'This is a test'
post.terms_names = {'category':articleCategories}
post.post_status = 'publish'
client.call(NewPost(post))
当我运行它时,我收到以下错误:
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:700)
你能帮忙吗?
最佳答案
根据我使用以下 WooCommerce api 的经验,最简单的解决方法是在客户端 URL 中使用 http://而不是 https://。我想同样的解决方案可能适用于您正在使用的 API。
您可以考虑使用 this您可能会发现更新且更易于使用的 WooCommerce API。
关于python - WordPress Api 请求错误 : [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl. c:700),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54159107/