[ejabberd] Error: REST request is rejected by service

Badlop badlop at gmail.com
Fri Jul 22 14:55:57 MSK 2016


With a similar configuration than you, using ejabberd 16.06 and recent
mod_rest,this call works correctly for me:

$ wget http://localhost:5280/rest/ --server-response --post-data
'<presence to="user1 at localhost" from="other at foo.com"><status>On the
phone</status></presence>'

--2016-07-22 13:51:22--  http://localhost:5280/rest/
S'està resolent localhost (localhost)… 127.0.0.1
S'està connectant a localhost (localhost)|127.0.0.1|:5280…connectat.
HTTP: s'ha enviat la petició, s'està esperant una resposta…
  HTTP/1.1 200 OK
  Content-Type: text/html; charset=utf-8
  Content-Length: 2

In ejabberd configuration file set loglevel te debug, then make the
request, and see if the ejabberd log files show any lines that mention
"REST" or similar.

---
Badlop
ProcessOne



On 22 July 2016 at 07:52, David Cunningham <dcunningham at voisonics.com> wrote:
> Hi,
>
> I'm trying to push presence updates to XMPP clients, and have been working
> with mod_rest. When an HTTP request is sent it gets an error "REST request
> is rejected by service". I'm sure the client IP is allowed in the mod_rest
> configuration so what could be wrong? Thanks in advance.
>
> BTW, if another method instead of mod_rest is recommended I'd be interested
> to hear it.
>
> Using ngrep:
>
> T XX.XX.246.78:42797 -> XX.XX.246.78:5285 [AP]
>   POST /rest HTTP/1.1..TE: deflate,gzip;q=0.3..Connection: TE, close..Host:
> foo.com:5285..User-Agent: foo 1.0..Content-Length: 132..Content-Type:
> application/x-www-form-urlencoded....<presence to="david at foo.com"
> from="other at foo.com"><status>On the phone</status></presence>
> ##
> T XX.XX.246.78:5285 -> XX.XX.246.78:42797 [AP]
>   HTTP/1.1 406 Not Acceptable..Content-Type: text/html;
> charset=utf-8..Content-Length: 43....Error: REST request is rejected by
> service.
>
> From ejabberd.yml:
>
>     port: 5285
>     module: ejabberd_http
>     request_handlers:
>        "/rest": mod_rest
>
> and:
>
> modules:
>   mod_rest:
>     allowed_ips:
>       - "XX.XX.246.78"
>
>
> --
> David Cunningham, Voisonics
> http://voisonics.com/
> USA: +1 213 221 1092
> Australia: +61 (0) 2 8063 9019
>
> _______________________________________________
> ejabberd mailing list
> ejabberd at jabber.ru
> http://lists.jabber.ru/mailman/listinfo/ejabberd
>


More information about the ejabberd mailing list