Created
December 4, 2017 09:28
-
-
Save recall704/805844cfc7095d2da51ea5a6c08abccd to your computer and use it in GitHub Desktop.
echo 中获取 json 请求
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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