diff --git a/servlet/rest-servlet.go b/servlet/rest-servlet.go index 7a38867..72c332d 100644 --- a/servlet/rest-servlet.go +++ b/servlet/rest-servlet.go @@ -96,7 +96,7 @@ func (s *RESTServlets) HandleGet(servletCtx server.ServletCtx, ctx *fasthttp.Req } func (s *RESTServlets) HandlePost(servletCtx server.ServletCtx, ctx *fasthttp.RequestCtx, mapping *MethodMapping) *csw.Error { - params := make([]string, 0) + params := make([][]byte, 0) if nil != mapping.ParamKeys { buf := ctx.PostBody() if nil == buf || 0 == len(buf) { @@ -113,11 +113,11 @@ func (s *RESTServlets) HandlePost(servletCtx server.ServletCtx, ctx *fasthttp.Re if !ok { return csw.NewError(fasthttp.StatusBadRequest, fmt.Errorf("Parameter for %s is not valied", k)) } - params = append(params, string(v)) + params = append(params, v) } } - _, err := s.restRegistry.Invoke(mapping.Method, params, servletCtx, ctx) + _, err := s.restRegistry.InvokeWithBytes(mapping.Method, params, servletCtx, ctx) if nil != err { return csw.NewError(fasthttp.StatusInternalServerError, err)