Skip to content

Instantly share code, notes, and snippets.

@recall704
Created December 4, 2017 09:28
Show Gist options
  • Save recall704/805844cfc7095d2da51ea5a6c08abccd to your computer and use it in GitHub Desktop.
Save recall704/805844cfc7095d2da51ea5a6c08abccd to your computer and use it in GitHub Desktop.
echo 中获取 json 请求
package main
import (
"github.com/labstack/echo"
)
func main() {
e := echo.New()
e.POST("/", func(c echo.Context) error {
m := echo.Map{}
if err := c.Bind(&m); err != nil {
return err
}
return c.JSON(200, m)
})
e.Logger.Fatal(e.Start(":1323"))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment