Hostname

Returns the hostname derived from the Host HTTP header.

  1. func (c *Ctx) Hostname() string
  1. // GET http://google.com/search
  2. app.Get("/", func(c *fiber.Ctx) error {
  3. c.Hostname() // "google.com"
  4. // ...
  5. })

Returned value is only valid within the handler. Do not store any references.
Make copies or use the
Immutable setting instead. Read more…