diff 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
parents 7b1eede1a840
children c87181a98f29
line wrap: on
line diff
--- a/mod_pubsub_post/README.markdown	Sun Oct 13 16:56:52 2019 +0200
+++ b/mod_pubsub_post/README.markdown	Sun Oct 13 23:09:32 2019 +0200
@@ -11,16 +11,28 @@
 Atom feeds, arbitrary XML, or arbitrary JSON. The type should be
 indicated via the `Content-Type` header.
 
+-   JSON data is wrapped in a [XEP-0335] container.
+-   An Atom feed may have many `<entry>` and each one is published as
+    its own PubSub item.
+-   Other XML is simply published to a randomly named item as-is.
+
+## JSON example
+
 ``` {.bash}
 curl http://localhost:5280/pubsub_post/princely_musings \
     -H "Content-Type: application/json" \
     --data-binary '{"musing":"To be, or not to be: that is the question"}'
 ```
 
--   JSON data is wrapped in a [XEP-0335] container.
--   An Atom feed may have many `<entry>` and each one is published as
-    its own PubSub item.
--   Other XML is simply published to a randomly named item as-is.
+## Atom example
+
+``` {.bash}
+curl http://localhost:5280/pubsub_post/princely_musings \
+    -H "Content-Type: application/xml" \
+    --data-binary '<feed xmlns="http://www.w3.org/2005/Atom">
+        <entry><title>Hello</title></entry></feed>'
+
+```
 
 # Configuration