Type
Sets the Content-Type HTTP header to the MIME type listed here specified by the file extension.
- c.Type(t string) string
- app.Get("/", func(c *fiber.Ctx) {
- c.Type(".html") // => "text/html"
- c.Type("html") // => "text/html"
- c.Type("json") // => "application/json"
- c.Type("png") // => "image/png"
- })