简体   繁体   English

WordPress REST API和WP JSON API是否不同?

[英]Are WordPress REST API and WP JSON API different?

I'm trying to code the user authentication feature for my app using API. 我正在尝试使用API​​为我的应用编写用户身份验证功能。 I'm confused between WordPress REST API and WordPress JSON API ? 我对WordPress REST APIWordPress JSON API感到困惑吗? Based on the Q&A here , it says I need WordPress JSON API. 根据这里问答 ,它说我需要WordPress JSON API。 If my WP already has REST API, do I still need this JSON API? 如果我的WP已经具有REST API,是否仍需要此JSON API?

Yes, they appear to be different. 是的,它们似乎有所不同。 The Wordpress REST API appears to be built into, and come with a Wordpress Installation. Wordpress REST API似乎是内置的,并随Wordpress安装一起提供。 I tested on my site , and was able to access the api for posts via a browser GET to /wp-json/wp/v2/posts . 我在自己的网站上进行了测试,并且能够通过浏览器GET访问/ wp-json / wp / v2 / posts来访问帖子的api。 This is just an example. 这只是一个例子。 I would imagine the other option you mentioned is a plugin that does something similar but the format of the requests look entirely different. 我想您提到的另一个选项是一个插件,它的功能相似,但请求的格式看起来完全不同。 I would stick with the first solution that comes out of the box. 我会坚持使用开箱即用的第一个解决方案。

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

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