XHR

A Boolean property, that is true, if the request’s X-Requested-With header field is XMLHttpRequest, indicating that the request was issued by a client library (such as jQuery).

  1. func (c *Ctx) XHR() bool
  1. // X-Requested-With: XMLHttpRequest
  2. app.Get("/", func(c *fiber.Ctx) error {
  3. c.XHR() // true
  4. // ...
  5. })