如何使用Python REST API在openfire中创建聊天室并将用户添加到聊天室中

2024-05-13 01:31:00 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在使用这个模块Openfire REST API

我编写main.py导入muc.py

from ofrestapi.muc import Muc
m = Muc(host = 'http://desktop-oam4s7o:9090', secret = 'poYixzhOJsPmB4tB')
m.add_room(roomname = 'test', name = 'test', description = 'test')

但它失败了,我遇到了一个异常:

ofrestapi.exception.InvalidResponseException: 500

任何人都可以使用一些Python for MUC服务示例来创建聊天室并将用户添加到聊天室中吗


Tags: 模块frompytestimportrestapihttp