Is

Returns the matching content type, if the incoming request’s Content-Type HTTP header field matches the MIME type specified by the type parameter.

If the request has no body, it returns false.
  1. c.Is(t string) bool
  1. // Content-Type: text/html; charset=utf-8
  2.  
  3. app.Get("/", func(c *fiber.Ctx) {
  4. c.Is("html") // true
  5. c.Is(".html") // true
  6. c.Is("json") // false
  7. })