echo中的post路由
post路由
e.POST("/users", save)
表单提交
- application/x-www-form-urlencoded
e.POST("/users", save)
func save(c echo.Context) error {
// 获取 name 和 email 的值
name := c.FormValue("name")
email := c.FormValue("email")
return c.String(http.StatusOK, "name:" + name + ", email:" + email)
}