(ctx dotweb.Context)
| 81 | } |
| 82 | |
| 83 | func PostJsonBind(ctx dotweb.Context) error { |
| 84 | type UserInfo struct { |
| 85 | UserName string `json:"user"` |
| 86 | Sex int `json:"sex"` |
| 87 | } |
| 88 | user := new(UserInfo) |
| 89 | errstr := "no error" |
| 90 | if err := ctx.BindJsonBody(user); err != nil { |
| 91 | errstr = err.Error() |
| 92 | } else { |
| 93 | |
| 94 | } |
| 95 | |
| 96 | return ctx.WriteString("PostBind [" + errstr + "] " + fmt.Sprint(user)) |
| 97 | } |
| 98 | |
| 99 | func InitRoute(server *dotweb.HttpServer) { |
| 100 | server.Router().POST("/", TestBind) |
nothing calls this directly
no test coverage detected