如何通过http从Openfire获取所有注册用户 [英] How to get all registered user from Openfire through http
问题描述
我正在尝试制作简单的Openfire插件.我有一个用户名的ArrayList,它是电话号码,我希望所有已注册的用户都来自它.ArrayList希望通过json通过get或post方法将ArrayList发送到服务器,但是我不知道我的插件如何侦听该请求并响应该用户.
对于您的特定要求,您应该检查 http://example.org:9090/plugins/restapi/v1/用户
GET http://example.org:9090/plugins/restapi/v1 /users?search = testuser
GET http://example.org:9090/plugins/restapi/v1/users /testuser
关于新的插件开发,我建议您从Rest-API开始,它已经开源,您可以签出代码并根据您的业务需求对其进行自定义,也可以根据项目结构使用它来开发自己的插件
还有一个客户端库,可作为 Rest-API客户端.>
I am trying to make Simple Openfire plugin.I have an ArrayList of usersnames which are phone numbers, i want all the registered users from it.The ArrayList want to send the ArrayList to server by json throung get or post method ,But i donot know how my plugin can listen for that request and respond to that user.
For your specific requirement you should check Openfire Rest-API Plugin.
The plugin already provides Users related operations over HTTP, like: Get overview over all or specific user and to create, update or delete a user.
So you can request all registered users in Openfire or You can query for a specific user if it's already registered or not. And it also supports authentication so your http endpoints will be secure.
Examples:
GET http://example.org:9090/plugins/restapi/v1/users
GET http://example.org:9090/plugins/restapi/v1/users?search=testuser
GET http://example.org:9090/plugins/restapi/v1/users/testuser
Regarding new plugin development, I would suggest you to start with Rest-API, it's already opensource, you can checkout the code and customize it as per your business needs or you can use it to develop your own plugin following it's project structure.
There is also a client library available as Rest-API Client.
这篇关于如何通过http从Openfire获取所有注册用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!