我Ejabberd
在ejabberd 16.09
. 要配置它,我只是关注 ejabberd 文档(https://docs.ejabberd.im/developer/ejabberd-api/simple-configuration/)。所以当我要从邮递员那里点击http://localhost:5280/api/change_password urlbody:
{
"user": "123",
"host": "TT_CPU_076",
"newpass": "blank"
}
我header:
Content-Type: application/json.
收到如下错误:
{
"status": "error",
"code": 31,
"message": "Command need to be run with admin priviledge."
}
我的 ejabberd.yml 文件配置如下:
port: 5280
module: ejabberd_http
ip: "127.0.0.1"
request_handlers:
"/websocket": ejabberd_http_ws
"/api": mod_http_api
## "/pub/archive": mod_http_fileserver
web_admin: true
http_bind: true
## register: true
captcha: false
api_permissions:
"API used from localhost allows all calls":
- who:
- ip: "127.0.0.1/8"
- what:
- "*"
- "!stop"
- "!start"
任何使用 ejabberd 实现 Rest Api 配置的解决方案都将不胜感激。