我的网站使用 Jetpack
JSON
插件来获取要在 iOS 应用程序中使用的 JSON
数据。
现在我可以访问我的网站 JSON 数据,并且可以在没有 OAuth 身份验证
的情况下使用以下 URL
开发 iOS 应用程序。
https://public-api.wordpress.com/rest/v1/sites/www.mywebsite.com/posts/
现在我阅读了有关这些 API 的文档,我看到了 API 的 OAuth2 Authentication
。
我的应用程序使用 JSON 数据仅用于显示。
我想知道我真的需要执行 OAuth2 身份验证
才能使用 JSON 数据吗?
最佳答案
好的,所以深入研究我看到的文档
Before you begin to develop an application, you will need a client id and a client secret key. The client id and client secret key will be used to authenticate your application and verify that the API calls being are valid. You can sign up for an id and secret at our
所以基本上您需要使用 JetPack 进行身份验证。这是链接:http://developer.wordpress.com/docs/oauth2/
如果你想知道这个api是否需要认证,那么你只要把url放到浏览器中,如果你得到json字符串,意味着不需要OAuth,否则,你需要认证。
关于ios - 我需要获取 API token 才能从 Jetpack API 获取 JSON 数据吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22011823/