简体   繁体   English

如何在Wordpress 4.1.1中访问REST API

[英]How do I access the REST API's in Wordpress 4.1.1

I am using wordpress and according to the documentation here I download it, install it and activate it. 我正在使用wordpress,根据这里的文档下载,安装并激活它。 However, it doesn't seem to be working when I go to 但是,当我去时,它似乎不起作用

localhost/wp-json/posts

I get a 404 我得到404

I think there may be a couple issues, one the official plugin site does not say it supports 4.1, however, some info suggests it may be included by default. 我认为可能存在一些问题,其中一个官方插件网站并未说它支持4.1,但是,一些信息表明它可能默认包含在内。 Also I tried using the git repo and that didn't seem to work either. 我也尝试使用git repo,这似乎也不起作用。

What am I doing wrong? 我究竟做错了什么?

UPDATE UPDATE

I changed permalinks to post name and I uncommented mod_rewrite in my httpd.conf but no dice. 我将永久链接更改为发布名称,并在httpd.conf中未注释mod_rewrite,但没有骰子。

You need to be using pretty permalinks to use the plugin, as it uses custom rewrite rules to power the API. 您需要使用漂亮的永久链接来使用该插件,因为它使用自定义重写规则来为API提供动力。

Check your permalink settings and be sure to your web server support rewrite. 检查您的永久链接设置,并确保您的Web服务器支持重写。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM