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.
  1. c.SendStatus(status int)
  1. app.Get("/not-found", func(c *fiber.Ctx) {
  2. c.SendStatus(415)
  3. // => 415 "Unsupported Media Type"
  4. c.Send("Hello, World!")
  5. c.SendStatus(415)
  6. // => 415 "Hello, World!"
  7. })