[GH-ISSUE #52] API errors should be JSON and be more user friendly #46

Closed
opened 2026-05-07 00:19:06 +02:00 by BreizhHardware · 1 comment

Originally created by @binwiederhier on GitHub (Dec 12, 2021).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/52

Right now:

$ curl -v -d "This was a little delayed" -H "Delay: 1s" ntfy.sh/abc
> POST /abc HTTP/1.1
> Host: ntfy.sh
> Delay: 1s
...
< HTTP/1.1 400 Bad Request
< Server: nginx
... 
Bad Request

Should be:

$ curl -v -d "This was a little delayed" -H "Delay: 1s" ntfy.sh/abc
> POST /abc HTTP/1.1
> Host: ntfy.sh
> Delay: 1s
...
< HTTP/1.1 400 Bad Request
< Server: nginx
< Content-Type: application/json
... 
{"error":192,"http":400,"message":"delay must be between 10s and 3 days"}
Originally created by @binwiederhier on GitHub (Dec 12, 2021). Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/52 Right now: ``` $ curl -v -d "This was a little delayed" -H "Delay: 1s" ntfy.sh/abc > POST /abc HTTP/1.1 > Host: ntfy.sh > Delay: 1s ... < HTTP/1.1 400 Bad Request < Server: nginx ... Bad Request ``` Should be: ``` $ curl -v -d "This was a little delayed" -H "Delay: 1s" ntfy.sh/abc > POST /abc HTTP/1.1 > Host: ntfy.sh > Delay: 1s ... < HTTP/1.1 400 Bad Request < Server: nginx < Content-Type: application/json ... {"error":192,"http":400,"message":"delay must be between 10s and 3 days"} ```
BreizhHardware 2026-05-07 00:19:06 +02:00
Author
Owner

@binwiederhier commented on GitHub (Dec 25, 2021):

Done

<!-- gh-comment-id:1001023694 --> @binwiederhier commented on GitHub (Dec 25, 2021): Done
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#46
No description provided.