You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "hongdingyi (via GitHub)" <gi...@apache.org> on 2023/02/17 10:47:09 UTC

[GitHub] [apisix] hongdingyi commented on issue #8875: how to use ext-plugin-pre-req change apisix request body。 base on apisix-go-plugin-runner

hongdingyi commented on issue #8875:
URL: https://github.com/apache/apisix/issues/8875#issuecomment-1434461049

   > Not yet supported
   
   Can you support me。thank you
   
   
   func(r *Request) SetBody(body []byte)error{
   	builder := util.GetBuilder()
   	varName := builder.CreateString(string(body))
   	ei.VarStart(builder)
   	ei.VarAddName(builder, varName)
   	varInfo := ei.VarEnd(builder)
   	_, err := r.askExtraInfo(builder, ei.InfoRespBody + 1, varInfo)
   	util.PutBuilder(builder)
   	return err
   }
   
   
       if info_type == extra_info.RespBody + 1 then
           local info = req:Info()
           local var_req = extra_info_var.New()
           var_req:Init(info.bytes, info.pos)
           local var_name = var_req:Name()
           core.request.set_body(var_name)
           res = 0
   
   
   function _M.set_body(new_body_data)
       ngx.req.set_body_data(new_body_data)
       ngx.req.set_header("Content-Length", tostring(#new_body_data))
   end


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org