This commit is contained in:
crusader 2018-04-12 16:14:18 +09:00
parent 87b2609eb0
commit 5fddc23005

View File

@ -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 { 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 { if nil != mapping.ParamKeys {
buf := ctx.PostBody() buf := ctx.PostBody()
if nil == buf || 0 == len(buf) { if nil == buf || 0 == len(buf) {
@ -113,11 +113,11 @@ func (s *RESTServlets) HandlePost(servletCtx server.ServletCtx, ctx *fasthttp.Re
if !ok { if !ok {
return csw.NewError(fasthttp.StatusBadRequest, fmt.Errorf("Parameter for %s is not valied", k)) 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 { if nil != err {
return csw.NewError(fasthttp.StatusInternalServerError, err) return csw.NewError(fasthttp.StatusInternalServerError, err)