Use net/http for default handler messages
This commit is contained in:
parent
45ec83b9d3
commit
2c930bacf1
2 changed files with 9 additions and 5 deletions
|
@ -35,6 +35,11 @@ func (c *Context) String(code int, s string) error {
|
|||
return err
|
||||
}
|
||||
|
||||
// StatusText returns the given status code with the matching status text
|
||||
func (c *Context) StatusText(code int) error {
|
||||
return c.String(code, http.StatusText(code))
|
||||
}
|
||||
|
||||
// NoContent returns the given status code without writing anything to the body
|
||||
func (c *Context) NoContent(code int) error {
|
||||
c.Response.WriteHeader(code)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue