I am trying to make some rest requests (without OAuth) but ejabberd response is always "HTTP/1.1 400 Bad Request"
Here is the detail:
ejabberd version: 16.02
ejabberd configuration
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
Request
curl -v -X POST -H "X-Admin: true" -H "Authorization: Basic YWRtaW5AcHJqLmlvOmFkbWlu" -H "Content-Type:application/json" http://prj.io:5280/api/status -d '{}'
Logs
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
Please help me out to understand ejabberd's behaviour and the way to post some requests to mod_http_api
.