404 on http://localhost/wp-json/wp/v2/posts in wordpress using REST API V2

hungryWolf picture hungryWolf · Jun 25, 2017 · Viewed 7.4k times · Source

I am getting a 404 on http://localhost/wp-json/wp/v2/posts route. I changed permalink type to plain. Still got the same issue.

If its useful, I am ubuntu 16.04 desktop recent upgrade from 15.10, suffered issues with php5.6 to 7.0 upgrade. Am now on php 7.0

Edit1: Tried every other permalink setting combination, no results!

Answer

Dilmurat Abduqayyum picture Dilmurat Abduqayyum · Aug 26, 2018

http://localhost/?rest_route=/wp/v2/posts should works. Refer https://developer.wordpress.org/rest-api/using-the-rest-api/discovery/ for details.