[ad_1]
Hi
I\`m trying to connect to wordpress api with python script and i\`m getting 403 error. I\`ve used that code some time ago and everything was fine. What is the problem?
My script:
AUTH_KEY = ’78rd YMUZ 3ogz p0rA ltwX u4iQ’
USER = xxx
URL = ‘https://localhost/wordpress/wp-json/wp/v2/media/’
CRED = USER + ‘:’ + AUTH_KEY
token = base64.b64encode(CRED.encode())
header = {‘Authorization’: ‘Basic ‘ + token.decode(‘utf-8’)}
try:
pics = requests.get(URL, headers=header)
print(pics)
except KeyboardInterrupt:
quit()
[ad_2]