我在亚马逊EC2实例上运行了Miniflux,我打算将该实例用于我的安卓应用程序。根据Miniflux文档here,我应该能够使用以下URL端点获得JSON响应:
www.mydomain/miniflux/jsonrpc.php在我的例子中是:
{
"jsonrpc":"2.0",
"id":null,
"error":{
"code":-32700,
"message":"Parse error"
}
}要以JSON格式获取更多信息,我需要传入更多参数,但是Miniflux文档没有解释如何传递。另一方面,URL有一个关于如何将OpenWeatherMap端点与API键一起使用的guide。任何关于这件事的建议都将非常感谢。
发布于 2016-03-31 01:15:29
首先转到miniflix首选项并选择您的JSON-RPC URL。它必须类似于:API endpoint: https://username.miniflux.net/jsonrpc.php。在那里,您还将获得:
API username: username
API token: swB3/nSo1CB1X2F (example)在rest客户端应用程序或chrome扩展中输入端点url。在邮递员上使用HTTP基本身份验证。意味着将您的登录用户名放入usename字段,将api标记放入poassword字段,然后单击Refresh headers按钮。
选择post方法(因为所有miniflux jsonrpc调用都是post),然后导航到"row“选项卡并编写查询,如下所示:{"url": "http://images.apple.com/main/rss/hotnews/hotnews.rss"}, "id": 1}
然后,您将看到json响应。
如果你想使用curl,它也很简单。
curl \
-u "demo:swB3/nSo1CB1X2F" \
-d '{"jsonrpc": "2.0", "method": "feed.create", "params": {"url": "http://images.apple.com/main/rss/hotnews/hotnews.rss"}, "id": 1}' \
https://demo.miniflux.net/jsonrpc.php我建议你花一些时间阅读他们的JsonRPC代码,然后你就会了解所有的miniflux api调用,响应和它是如何工作的。
发布于 2016-07-24 16:56:27
例如,假设您的miniflux API报告以下参数:
API username: username
API endpoint: https://username.miniflux.net/jsonrpc.php
API token: swB3/nSo1CB1X2Fminiflux提升您想要的方法,直接在miniflux文档中使用curl -d语句。例如,对于列出所有提要的方法(为方便起见,将其称为'payload'):
payload = {"jsonrpc":"2.0","method":"feed.list","id":1}
auth=('username','swB3/nSo1CB1X2F')
响应= requests.post('https://username.miniflux.net/jsonrpc.php',auth=auth,data=json.dumps(有效负载),response
- using python3
https://stackoverflow.com/questions/35800672
复制相似问题