代码:
import requests import json import base64 url = "https://www.xacisco.net/blog/wp-json/wp/v2/doc" user = "xxxx" password = "xxx" credentials = user + ':' + password token = base64.b64encode(credentials.encode()) header = {'Authorization': 'Basic ' + token.decode('utf-8')} postID='39823' responce = requests.delete(url + postID , headers=header) print(responce)
遇到的都是404的错误