0
votes

How can I connect on a Wordpress website (and get it posts) using REST api? What I did:

  1. Installed the REST plugin on Wordpress (https://wordpress.org/plugins/json-rest-api/)
  2. Enabled it

But I can't get the posts. Only if I use CURL (but I would like to use requests)

import requests, json

r = requests.get('http://www.uaigeek.com.br/blog/wp-json/posts', auth=('admin', 'pass'))
print r.status_code

print r.json

Using CURL (curl -I http://www.uaigeek.com.br/blog/wp-json/posts) it works like a charm, but using requests it always get 403 error (sometimes 404).

How can I do that?

1

1 Answers

0
votes

Solved! It was a "problem" from Site5 host, they block requests, I've to ask for this permission and it works like a charm now.