我能解决这个问题
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 ) )。