Fiber: c.Body() can't read raw data

Created on 12 Feb 2020  ยท  4Comments  ยท  Source: gofiber/fiber

I don't get data from c.Body ("email") when I request via postman with Raw Body

Raw Data

{
  "email": "[email protected]"
}

Code snippet

package main

import "github.com/gofiber/fiber"

func main() {
  app := fiber.New()

  app.Post("/login", func (c *fiber.Ctx) {
    c.Body("email") // no value here
  })

  app.Listen(8080)
}

Most helpful comment

Hi @Aguezz,
If you format your data in this way: key=value, it works :)

image

All 4 comments

Thanks for opening your first issue here! ๐ŸŽ‰ Be sure to follow the issue template!

Hi, you have created an empty issue1 in the bug-tracker of this repository2.

The Issue tab of repositories on GitHub is meant to report problems with the repository or to discuss features of the project. If you have an actual issue with the repository, please open a new issue with a decent description.

Have fun exploring this repository ๐ŸŽ‰

If you want to know more about how to write good issues, look here: https://guides.github.com/features/issues/


1: Issue โ‡พ Bug Report / Feature Request / etc..
2: Repository โ‡พ Project

Hi @Aguezz,
If you format your data in this way: key=value, it works :)

image

@MarvinJWendt
Thank you... That works ๐Ÿฅณ

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bashery picture bashery  ยท  4Comments

lucasmdomingues picture lucasmdomingues  ยท  3Comments

Terisback picture Terisback  ยท  3Comments

slalbertojesus picture slalbertojesus  ยท  4Comments

mewben picture mewben  ยท  3Comments