Software / code / prosody-modules
Comparison
mod_pubsub_post/README.markdown @ 3719:a6db99c1420a
mod_pubsub_post/README: Add an example of curl-ing Atom data
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sun, 13 Oct 2019 23:09:32 +0200 |
| parent | 3506:7b1eede1a840 |
| child | 4552:c87181a98f29 |
comparison
equal
deleted
inserted
replaced
| 3718:cc6f7e2e4a59 | 3719:a6db99c1420a |
|---|---|
| 9 This module is a fairly generic WebHook receiver that lets you easily | 9 This module is a fairly generic WebHook receiver that lets you easily |
| 10 publish data to PubSub using a HTTP POST request. The payload can be | 10 publish data to PubSub using a HTTP POST request. The payload can be |
| 11 Atom feeds, arbitrary XML, or arbitrary JSON. The type should be | 11 Atom feeds, arbitrary XML, or arbitrary JSON. The type should be |
| 12 indicated via the `Content-Type` header. | 12 indicated via the `Content-Type` header. |
| 13 | 13 |
| 14 - JSON data is wrapped in a [XEP-0335] container. | |
| 15 - An Atom feed may have many `<entry>` and each one is published as | |
| 16 its own PubSub item. | |
| 17 - Other XML is simply published to a randomly named item as-is. | |
| 18 | |
| 19 ## JSON example | |
| 20 | |
| 14 ``` {.bash} | 21 ``` {.bash} |
| 15 curl http://localhost:5280/pubsub_post/princely_musings \ | 22 curl http://localhost:5280/pubsub_post/princely_musings \ |
| 16 -H "Content-Type: application/json" \ | 23 -H "Content-Type: application/json" \ |
| 17 --data-binary '{"musing":"To be, or not to be: that is the question"}' | 24 --data-binary '{"musing":"To be, or not to be: that is the question"}' |
| 18 ``` | 25 ``` |
| 19 | 26 |
| 20 - JSON data is wrapped in a [XEP-0335] container. | 27 ## Atom example |
| 21 - An Atom feed may have many `<entry>` and each one is published as | 28 |
| 22 its own PubSub item. | 29 ``` {.bash} |
| 23 - Other XML is simply published to a randomly named item as-is. | 30 curl http://localhost:5280/pubsub_post/princely_musings \ |
| 31 -H "Content-Type: application/xml" \ | |
| 32 --data-binary '<feed xmlns="http://www.w3.org/2005/Atom"> | |
| 33 <entry><title>Hello</title></entry></feed>' | |
| 34 | |
| 35 ``` | |
| 24 | 36 |
| 25 # Configuration | 37 # Configuration |
| 26 | 38 |
| 27 All settings are optional. | 39 All settings are optional. |
| 28 | 40 |