Echo: How to send a 204 Response?

Created on 22 Oct 2015  路  2Comments  路  Source: labstack/echo

return c.JSON(204, nil)

gives this in the console:
2015/10/22 16:11:04 http: request method or response status code does not allow body

While it is harmless, I was hoping there would be a better way to send a 204.

question

Most helpful comment

You should use c.NoContent(204)

All 2 comments

You should use c.NoContent(204)

Yep! Works, thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kyokomi picture kyokomi  路  3Comments

linux-support picture linux-support  路  3Comments

vishr picture vishr  路  3Comments

asdine picture asdine  路  3Comments

neutronstein picture neutronstein  路  3Comments