File tree 1 file changed +9
-3
lines changed
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 60
60
61
61
<h2 id="publish" class="anchor">Publishing messages</h2>
62
62
<p>
63
- Publishing messages can be done via PUT or POST using . Topics are created on the fly by subscribing or publishing to them.
63
+ Publishing messages can be done via PUT or POST. Topics are created on the fly by subscribing or publishing to them.
64
64
Because there is no sign-up, <b>the topic is essentially a password</b>, so pick something that's not easily guessable.
65
65
</p>
66
66
<p class="smallMarginBottom">
67
- Here's an example showing how to publish a message using <tt>curl</tt>:
67
+ Here's an example showing how to publish a message using <tt>curl</tt> (via POST) :
68
68
</p>
69
69
<code>
70
- curl -d "long process is done" ntfy.sh/mytopic
70
+ curl -d "Backup successful 😀" ntfy.sh/mytopic
71
+ </code>
72
+ <p class="smallMarginBottom">
73
+ And another one using PUT:
74
+ </p>
75
+ <code>
76
+ echo -en "\u26A0\uFE0F Unauthorized login" | curl -sT- ntfy.sh/mytopic
71
77
</code>
72
78
<p class="smallMarginBottom">
73
79
Here's an example in JS with <tt>fetch()</tt> (see <a href="https://github.com/binwiederhier/ntfy/tree/main/examples">full example</a>):
You can’t perform that action at this time.
0 commit comments