如果我将 JSON 数据发布到 gofiber 中的 /post route,我将如何读取和更改这些值:
{
"name" : "John Wick"
"email" : "johnw@gmail.com"
}
Run Code Online (Sandbox Code Playgroud)
app.Post("/post", func(c *fiber.Ctx) error {
//read the req.body here
name := req.body.name
return c.SendString(name)
}
Run Code Online (Sandbox Code Playgroud)