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/

相关文章:

php - CSS Bootstrap 响应式菜单差异

javascript - 调用 API 的 ajax 的最佳位置是什么?

java - onLocationChange() 未被调用...使用 FuseLocationApi ...检查了所有解决方案并尝试了所有...但仍然没有任何效果

Python正则表达式来替换除特定单词之外的所有内容

python - 我应该在 python 游戏服务器中使用什么方法来保持滴答时间?

html - 优化嵌入式链接,以便在所有浏览器和网络托管平台上使用

reactjs - 如何有一个单独的 js 文件来处理 Reactjs 中的 API 调用

python - 获取PCAP文件中的所有ip

python - 点击后 Dash DropDown 关闭

WordPress 主页不是主网址