How to get REST response in JSON
-
I want to use the REST api and expect responses in json as is standard for REST. Yet this request gives me a response in html:
http://ellehauge.net/wp/v2/posts/
Also tried some variations like this:
http://ellehauge.net/wp/v2/posts/?_format=jsonHow do I get the response in json?
I can’t seem to find that in the documentation. -
Sorry, I just realized that this is wordpress.com and not wordpress.org for self hosted sites.
-
Found out, it works like this:
http://ellehauge.net/wp-json/wp/v2/posts/Guess I got fooled by the ‘postman’ extension for chrome!
I started by accessing the endpoint http://ellehauge.net/wp-json/ and then clicked on one of the links and assumed that postman opened it correctly, it didn’t.
- The topic ‘How to get REST response in JSON’ is closed to new replies.