Software /
code /
prosody-modules
Diff
mod_rest/README.markdown @ 4920:bdac7c717c91
mod_rest: Support parameters in callback URL
E.g.
rest_callback_url = "http://myapi.example:5000/api/{kind}/{type}"
which results in e.g. requests to /api/message/chat
Allows using path routing in web frameworks for dispatch instead of
having to pick apart the payload to further dispatch it.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 09 Apr 2022 00:41:18 +0200 |
parent | 4919:b9f8dd9a7fdb |
child | 4922:c83b009b5bc5 |
line wrap: on
line diff
--- a/mod_rest/README.markdown Sat Apr 09 00:37:55 2022 +0200 +++ b/mod_rest/README.markdown Sat Apr 09 00:41:18 2022 +0200 @@ -130,6 +130,10 @@ rest_callback_url = "http://my-api.example:9999/stanzas" ``` +The callback URL supports a few variables from the stanza being sent, +namely `{kind}` (e.g. message, presence, iq or meta) and ones +corresponding to stanza attributes: `{type}`, `{to}` and `{from}`. + The preferred format can be indicated via the Accept header in response to an OPTIONS probe that mod_rest does on startup, or by configuring: