getting 403 when trying to connect to wordpress api

[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]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer