type Data struct { //Values that equivalent to your ajax post Data string Id int Name string}var data Datareq := this.Ctx.Requestdec := json.NewDecoder(req.Body)err := dec.Decode(&data)if err == nil { this.Data["JSON"] = &data this.ServeJSON()}Dont forget to import encoding/json