使用WordPress posts API新增文章(使用Python)

如何使用 WordPress posts API 來新增文章呢?

可以先參考官方資料:

https://developer.wordpress.org/rest-api/reference/posts/#create-a-post

而 API的位置在: https://{hostname}/wp/v2/posts

而新增一篇文章的方式有了這些資料就可以很快速地建立起來, 另外我們還需要先有一個 application password 來進行驗證才行, 在 WordPress 5.6 版本起, 可以在使用者下建立 application password, 所以可以透過這個方式來進行驗證, 可以參考這裡:

https://make.wordpress.org/core/2020/11/05/application-passwords-integration-guide/

Exit mobile version