Body

Returns the raw request body.

  1. func (c *Ctx) Body() []byte
  1. // curl -X POST http://localhost:8080 -d user=john
  2. app.Post("/", func(c *fiber.Ctx) error {
  3. // Get raw body from POST request:
  4. return c.Send(c.Body()) // []byte("user=john")
  5. })

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