我正在尝试发出一些休息请求(没有 OAuth),但 ejabberd 响应始终是“HTTP/1.1 400 Bad Request”
这是详细信息:
ejabberd 版本: 16.02
ejabberd 配置
port: 5280
ip: "::"
module: ejabberd_http
request_handlers:
##"/websocket": ejabberd_http_ws
##"/oauth": ejabberd_oauth
"/api": mod_http_api
## "/pub/archive": mod_http_fileserver
web_admin: true
http_bind: true
http_poll: true
## register: true
captcha: false
commands_admin_access: configure
commands:
- add_commands: user
oauth_expire: 3600
oauth_access: all
要求
curl -v -X POST -H "X-Admin: true" -H "Authorization: Basic YWRtaW5AcHJqLmlvOmFkbWlu" -H "Content-Type:application/json" http://prj.io:5280/api/status -d '{}'
日志
2016-03-26 04:38:04.711 [debug] <0.490.0>@ejabberd_http:process_header:281 (#Port<0.16265>) http query: 'POST' <<"/api/status">>
2016-03-26 04:38:04.711 [debug] <0.490.0>@ejabberd_http:extract_path_query:395 client data: <<"{}">>
2016-03-26 04:38:04.711 [debug] <0.490.0>@ejabberd_http:process:353 [<<"api">>,<<"status">>] matches [<<"api">>]
2016-03-26 04:38:04.711 [info] <0.490.0>@mod_http_api:log:388 Admin call status [] from ::FFFF:192.168.117.1:53583
请帮助我了解 ejabberd 的行为以及将一些请求发布到mod_http_api
.