SendStatus
Sets the status code and the correct status message in the body, if the response body is empty.
You can find all used status codes and messages here.
- c.SendStatus(status int)
- app.Get("/not-found", func(c *fiber.Ctx) {
- c.SendStatus(415)
- // => 415 "Unsupported Media Type"
- c.Send("Hello, World!")
- c.SendStatus(415)
- // => 415 "Hello, World!"
- })