首页 > 编程知识 正文

wordpress开发,python 编写api接口

时间:2023-05-03 18:47:22 阅读:39023 作者:1787

我能解决这个问题

b .根据那里的帮助文本为您的用户名创建密码字符串-假设它是mypassword123

现在在你的终端上做这个

'管理员: mypassword123“|基础64”

将获取新密码。 例如,pwdabc123

d .代码看起来像URL _ src dest=' http://example.com/WP-JSON/WP/v2/pages/'

headers={ ' content-type ' : ' application/JSON ',

'授权' : ' basicpwdabc 123 ',

' Username': ',

' Password':'pwdabc123'}

数据=

{

' title ' : ' testingviaapiviapython ',

'内容' : ' testcontentofthethistestpageviapython ',

' status': 'publish '

}

response=requests.post (URL _ src dest,data=JSON.dumps(data ),headers=headers ) )。

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。