When an API client makes an HTTP request to an API gateway with an Accept header containing the value "application/json", the valid HTTP response payload should be in JSON format. The correct JSON format for indicating a healthy status is {"status": "healthy"}. This format uses a JSON object with a key-value pair where the key is "status" and the value is "healthy".
Other options provided are not valid JSON responses:
healthy is XML format.
status('healthy') and status: healthy are not valid JSON syntax.
References
HTTP Content Negotiation and Accept Headers
JSON Formatting and Syntax Rules
Contribute your Thoughts:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit