[GH-ISSUE #16] curl -s doesn't work #14

Closed
opened 2026-05-07 00:18:31 +02:00 by BreizhHardware · 8 comments

Originally created by @DUOLabs333 on GitHub (Nov 23, 2021).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/16

I can successfully push a message to, but I can't get it in a GET request with curl -s

Originally created by @DUOLabs333 on GitHub (Nov 23, 2021). Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/16 I can successfully push a message to, but I can't get it in a GET request with `curl -s`
Author
Owner

@binwiederhier commented on GitHub (Nov 23, 2021):

Can you give a concrete example? Remember that the GET requires that you add /json or /raw or /sse at the end. Check out the examples on https://ntfy.sh/#subscribe-api

<!-- gh-comment-id:977209734 --> @binwiederhier commented on GitHub (Nov 23, 2021): Can you give a concrete example? Remember that the GET requires that you add /json or /raw or /sse at the end. Check out the examples on https://ntfy.sh/#subscribe-api
Author
Owner

@DUOLabs333 commented on GitHub (Nov 23, 2021):

Do curl -d "long process is down" ntfy.sh/duolabs333, then curl -s ntfy.sh/duolabs333/raw. Nothing returns.

<!-- gh-comment-id:977224949 --> @DUOLabs333 commented on GitHub (Nov 23, 2021): Do `curl -d "long process is down" ntfy.sh/duolabs333`, then `curl -s ntfy.sh/duolabs333/raw`. Nothing returns.
Author
Owner

@binwiederhier commented on GitHub (Nov 23, 2021):

Oh I see the confusion. The GET is a connection that stays open forever. If you open the GET first and then PUT/POST you'll see your messages in the GET. I should make a video...

You can also poll using ?poll=1

I'm not on my computer, otherwise I'd give you a detailed example.

<!-- gh-comment-id:977235228 --> @binwiederhier commented on GitHub (Nov 23, 2021): Oh I see the confusion. The GET is a connection that stays open forever. If you open the GET first and then PUT/POST you'll see your messages in the GET. I should make a video... You can also poll using ?poll=1 I'm not on my computer, otherwise I'd give you a detailed example.
Author
Owner

@DUOLabs333 commented on GitHub (Nov 23, 2021):

Ok, I see that now.

<!-- gh-comment-id:977236723 --> @DUOLabs333 commented on GitHub (Nov 23, 2021): Ok, I see that now.
Author
Owner

@DUOLabs333 commented on GitHub (Nov 23, 2021):

Is there a way to get the last n messages?

<!-- gh-comment-id:977237188 --> @DUOLabs333 commented on GitHub (Nov 23, 2021): Is there a way to get the last `n` messages?
Author
Owner

@binwiederhier commented on GitHub (Nov 23, 2021):

Long polling (connection stays open forever (:

# In window 1 (do this FIRST)
curl -s ntfy.sh/duolabs333/raw

# In window 2
curl -d "long process is down" ntfy.sh/duolabs333

Polling:

# In window 1
curl -d "long process is down" ntfy.sh/duolabs333

# In window 2
curl -s "ntfy.sh/duolabs333/raw?poll=1"

Check out the since= param to message since a timestamp.

<!-- gh-comment-id:977238333 --> @binwiederhier commented on GitHub (Nov 23, 2021): Long polling (connection stays open forever (: ``` # In window 1 (do this FIRST) curl -s ntfy.sh/duolabs333/raw # In window 2 curl -d "long process is down" ntfy.sh/duolabs333 ``` Polling: ``` # In window 1 curl -d "long process is down" ntfy.sh/duolabs333 # In window 2 curl -s "ntfy.sh/duolabs333/raw?poll=1" ``` Check out the since= param to message since a timestamp.
Author
Owner

@binwiederhier commented on GitHub (Nov 23, 2021):

Since: https://ntfy.sh/#fetching-cached-messages

<!-- gh-comment-id:977238953 --> @binwiederhier commented on GitHub (Nov 23, 2021): Since: https://ntfy.sh/#fetching-cached-messages
Author
Owner

@DUOLabs333 commented on GitHub (Nov 23, 2021):

Ok, thank you.

<!-- gh-comment-id:977239640 --> @DUOLabs333 commented on GitHub (Nov 23, 2021): Ok, thank you.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ntfy#14
No description provided.