[GH-ISSUE #262] 400 Bad request on webhook for missing double-inverted commas #194

Closed
opened 2026-02-25 23:41:32 +03:00 by kerem · 4 comments
Owner

Originally created by @ktkaushik on GitHub (Jun 22, 2019).
Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/262

In the Request Body for Webhook intergrations, i added -

{ message: "$NAME went $STATUS" }

This renders a 400 - bad request on my express server. On trying out a few other ideas, i realised that not adding message as "message" did that.

It works if add the double inverted commas -

{ "message": "$NAME went $STATUS" }

Image for reference -

Screenshot 2019-06-22 at 12 38 10 PM

Is this intentional? Do you think the Object key without double inverted commas can be made to work please?

Originally created by @ktkaushik on GitHub (Jun 22, 2019). Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/262 In the `Request Body` for **Webhook intergrations**, i added - ```javascript { message: "$NAME went $STATUS" } ``` This renders a `400 - bad request` on my express server. On trying out a few other ideas, i realised that not adding `message` as `"message"` did that. It works if add the double inverted commas - ```javascript { "message": "$NAME went $STATUS" } ``` Image for reference - <img width="647" alt="Screenshot 2019-06-22 at 12 38 10 PM" src="https://user-images.githubusercontent.com/877806/59961502-31360400-94f6-11e9-8833-1712d85b40a7.png"> Is this intentional? Do you think the Object key without double inverted commas can be made to work please?
kerem closed this issue 2026-02-25 23:41:32 +03:00
Author
Owner

@cuu508 commented on GitHub (Jun 22, 2019):

I'm not sure I understand what the issue is.
Did Healthchecks send a payload that looks different from what you had entered in webhook configuration?

<!-- gh-comment-id:504657142 --> @cuu508 commented on GitHub (Jun 22, 2019): I'm not sure I understand what the issue is. Did Healthchecks send a payload that looks different from what you had entered in webhook configuration?
Author
Owner

@ktkaushik commented on GitHub (Jun 22, 2019):

It just gave bad request which would mean that the payload is not JSON.

Basically, if i didn't put double inverted commas in the key of the Request body then it's not a JSON payload that i receive on my webhook deeming it as Bad Request with 400 status code

<!-- gh-comment-id:504657334 --> @ktkaushik commented on GitHub (Jun 22, 2019): It just gave bad request which would mean that the payload is not JSON. Basically, if i didn't put double inverted commas in the key of the `Request body` then it's not a JSON payload that i receive on my webhook deeming it as `Bad Request with 400 status code`
Author
Owner

@cuu508 commented on GitHub (Jun 22, 2019):

Yep, { message: "$NAME went $STATUS" } is indeed not a valid JSON document.

Healthchecks doesn't do any special formatting on the POST body: whatever you put there is what gets sent. You could post JSON, XML, just a plain text string etc.

<!-- gh-comment-id:504657949 --> @cuu508 commented on GitHub (Jun 22, 2019): Yep, `{ message: "$NAME went $STATUS" }` is indeed not a valid JSON document. Healthchecks doesn't do any special formatting on the POST body: whatever you put there is what gets sent. You could post JSON, XML, just a plain text string etc.
Author
Owner

@ktkaushik commented on GitHub (Jun 23, 2019):

Cool. Thanks @cuu508

<!-- gh-comment-id:504717065 --> @ktkaushik commented on GitHub (Jun 23, 2019): Cool. Thanks @cuu508
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/healthchecks#194
No description provided.