python - WordPress Api 请求错误 : [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl. c:700)

标签 python wordpress api ssl

我正在尝试使用带有 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/

相关文章:

Java Sound API 无法在 Web 应用程序 UI 中单击按钮时停止录制

python - “zsh: illegal hardware instruction python” 在 macbook pro M1 上使用 Tensorflow

python - 玛雅Python : Making clusters on curve CVs

php - IIS 和 PHP : HTTP Error 404. 3 - 未找到:由于扩展配置,无法提供您请求的页面

php - 如何扩展 Magento API catalog_product.list 以包含更多产品信息 XML-RPC

c++ - 是否可以从 C++ 中删除在 Python 中分配的对象?

python - 为什么 setup.py 安装旧文件?

python - 如何检查变量是否是类对象

notifications - 当所有插件都已更新时,Wordpress 显示我有 1 个插件更新

html - 如何在不更改 html 和比率的情况下裁剪图像高度(并将其居中)?