comparison mod_rest/README.markdown @ 4921: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
parents b9f8dd9a7fdb
children c83b009b5bc5
comparison
equal deleted inserted replaced
4920:b9f8dd9a7fdb 4921:bdac7c717c91
127 127
128 ``` {.lua} 128 ``` {.lua}
129 Component "rest.example.net" "rest" 129 Component "rest.example.net" "rest"
130 rest_callback_url = "http://my-api.example:9999/stanzas" 130 rest_callback_url = "http://my-api.example:9999/stanzas"
131 ``` 131 ```
132
133 The callback URL supports a few variables from the stanza being sent,
134 namely `{kind}` (e.g. message, presence, iq or meta) and ones
135 corresponding to stanza attributes: `{type}`, `{to}` and `{from}`.
132 136
133 The preferred format can be indicated via the Accept header in response 137 The preferred format can be indicated via the Accept header in response
134 to an OPTIONS probe that mod_rest does on startup, or by configuring: 138 to an OPTIONS probe that mod_rest does on startup, or by configuring:
135 139
136 ``` {.lua} 140 ``` {.lua}