我在 http://localhost/wp-json/wp/v2/posts 上收到 404路线。我将永久链接类型更改为普通。仍然遇到同样的问题。
如果它有用,我是 ubuntu 16.04 桌面,最近从 15.10 升级,遇到了 php5.6 到 7.0 升级的问题。我现在使用 php 7.0
编辑1: 尝试了所有其他永久链接设置组合,没有结果!
最佳答案
http://localhost/?rest_route=/wp/v2/posts
应该有效。
引用https://developer.wordpress.org/rest-api/using-the-rest-api/discovery/了解详情。
关于angularjs - http ://localhost/wp-json/wp/v2/posts in wordpress using REST API V2 上的 404,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44750315/