Use status 204 to return no content.
module.exports = {
paths: '/ping',
handler: function (state) {
state.res.statusCode = 204
return null
}
}
null stops the route chain. Without a bodyless status, nullish results become {} for POST and an empty string otherwise. HEAD, 204, 304, and all 3xx responses have no body.
Next: Direct responses →